]> 4ch.mooo.com Git - 16.git/blob - 16/lib/intro/M13ORG.ASC
906ec42ca66411cc86e66b9f266989a8045fc1cc
[16.git] / 16 / lib / intro / M13ORG.ASC
1 Figure 1: Memory organization in mode 13h (ASCII version)\r
2           by Robert Schmidt\r
3           (C) 1993 Ztiff Zox Softwear\r
4 \r
5 a. Imagine that the top of the screen looks like this (pixel values are\r
6    represented by color digits 0-9 for simplicity - actual colors may\r
7    range from 0 to 255) - a screen width of 320 pixels is assumed:\r
8 \r
9     address:  0         10                310      319\r
10              ----------------------------------------\r
11              |0123456789012345    .....   0123456789|\r
12              |                                      |\r
13              |                                      |\r
14              |\r
15 \r
16 b. In VGA memory, the screen is represented as follows (question marks\r
17    represent unused bytes):\r
18 \r
19    Plane 0:\r
20 \r
21     address:  0         10                310      319\r
22              ----------------------------------------\r
23              |0???4???8???2???    .....   ??2???6???|\r
24              |                                      |\r
25              |                                      |\r
26 \r
27    Plane 1:\r
28 \r
29     address:  0         10                310      319\r
30              ----------------------------------------\r
31              |?1???5???9???3??    .....   ???3???7??|\r
32              |                                      |\r
33              |                                      |\r
34 \r
35    Plane 2:\r
36 \r
37     address:  0         10                310      319\r
38              ----------------------------------------\r
39              |??2???6???0???4?    .....   0???4???8?|\r
40              |                                      |\r
41              |                                      |\r
42 \r
43    Plane 3:\r
44 \r
45     address:  0         10                310      319\r
46              ----------------------------------------\r
47              |???3???7???1???5    .....   ?1???5???9|\r
48              |                                      |\r
49              |                                      |\r
50 \r
51    I.e. a plane is selected automatically by the two least significant\r
52    bits of the address of the byte being read from or written two.\r
53    This renders 3/4 of the video memory unavailable and useless, but\r
54    all visible pixels are easily accessed, as each address in the video\r
55    segment provides access to one and ONLY ONE pixel.\r