Section two: Memory locations


This section is mainly concerned with exploring the area of memory known as 'page three'. This area extends from location &300 to &3FF. It is used for storage by the VDU drivers. Some other locations are discussed where necessary.

Before I started to investigate the uses of each location, I made a list of the sort of information I expected to find:

   1)   The lowest address used by the current screen mode.
   2)   The address of the top-left corner of the screen, since scrolling will alter this address.
   3)   The coordinates of the cursor.
   4)   The size of the current screen mode, in terms of characters per line and lines per page.
   5)   The graphics resolution of the current mode.
   6)   The number of available colours in the current mode.
   7)   Whether the current mode allows graphics as well as text.
   8)   The text background and foreground colours.
   9)   The graphics foreground and background colours, and the GCOL modifier.
   10)   The printer enable flag. (It is worth pointing out that this flag will probably occupy a single bit, and there are 2048 bits in page three. You can see that the task ahead is not easy!)
   11)   The separate/joined text and graphics cursor flag.
   12)   The page mode on/off flag.
   13)   VDU drivers enable/disable flag.
   14)   Flags for whether to use the character generator in ROM or RAM, for user-defined characters.
   15)   The extent of the graphics window.
   16)   The current screen mode.
   17)   The current and last position of the graphics cursor.
   18)   The extent of the current text window.
   19)   Whether scrolling should take place over the whole screen, using the 6845, or locally, area by area.
   20)   The number of bytes scrolled.
   21)   The actual colour of each logical colour.
   22)   The edit mode on/off flag.

The following list of memory locations is in numerical order of address, rather than the order in which I found out their uses. Most sections also detail how I discovered the use of each location, information which could be useful to you in the future, as well as being interesting in its own right.

I would suggest that you read the chapter on VDU drivers in the Users Guide thoroughly before progressing with this section.

Before we start, I should explain the difference between the two methods of scrolling the screen and of clearing it.

When no text window is defined, CLS clears the screen by using a nifty bit of circuitry in the ULA to do it in hardware very quickly. However, when there is a text window active, it clears the screen by copying the background colour into every screen location in the window. This is much more time consuming, but it carries the advantage that it doesn't move the screen RAM so that HIMEM Points to the first screen location, as does a normal CLS. CLG works by copying a value into every location, by software. In addition, all the GCOL modifier rules have to be followed, which is why it is so slow.

Text is normally scrolled by altering the 6845's registers 12 and 13. This is very quick, but carries the disadvantage of moving VDU RAM around with reference to the first location on the screen. When a text window is in operation, even if it occupies the whole screen, scrolling takes place by copying each location 'backwards'. Again, although this is slow, it doesn't interfere with registers 12 and 13, which can often be extremely useful.


Locations &320 and &321 -- Screen memory start. (16 bits).

LSB MSB


In the same way as I presented the contents of the 6845 registers under various modes, here are the contents of locations &320 and &321 in each mode:

Mode--01234567
Contents--1228812288122881638422528225282457631744

These values should be instantly recognizable as the value of HIMEM in each of the modes. So it would be safe to assume that this location contains the lowest memory address used for the current screen mode. But look at the program I used to get these values.

   10 DIM A%(255,7)
   20 FOR T%=0 TO 7
   30 MODE T%
   40 VDU 28,1,20,17,3
   50 VDU 24,60;50;532;432;
   60 COLOUR 3
   70 COLOUR 2+128
   80 GCOL 1,4
   90 GCOL 4,128+5
  100 MOVE 123,345
  110 MOVE 234,421
  120 VDU 29,500;490;
  130 FOR M%=0 TO 255
  140 A%(M%,T%)=?(&300+M%)
  150 NEXT M%
  160 NEXT T%
  170 @%=4
  180 VDU 2
  190 MODE 0
  200 FOR M%=0 TO 255
  210 PRINT "|";~M%+&300;" |";
  220 FOR T%=0 TO 7
  230 PRINT A%(M%,T%);
  240 NEXT T%
  250 PRINT " |"'"|";TAB(39);"|"'STRING$
(40,"--")
  260 NEXT M%
  270 VDU 3


As you can see, the section from lines 40 to 120 set up various parameters, to give something distinctive to look for in each mode. For example, if we later find a byte holding 17, we could be right in assuming that it has something to do with the text window in line 40 (the complete printout from this program appears at the end of the chapter). The problem is that none of those statements make the screen scroll, so the value in &320 could be the top of page address. Both are the same before scrolling takes place. So, to see which it is, scroll the screen a few times, and then investigate the contents of these locations again. You will see they haven't changed so this location must store the lowest address used by the current screen mode.

Having discovered that, the next step is to see what happens when we alter this location. Try putting the machine in mode 4, and then typing '?&321=&F'. This is telling the computer that video RAM starts at location &F00. But nothing happens after you do this. Try typing 'CLS'. After you do this the screen will do anything but clear. You'll probably see a lot of garbage on it. Ignore all the rubbish for the moment, and type 'CLG'. The rubbish will disappear. The trouble is, the CLS mechanism is carried out by the ULA, and it has not been told that VDU RAM has moved so at every CLS, it will clear the wrong area of memory. The 6845 will now have moved VDU RAM to start at location &F00. The other problem is that the ULA will scroll the screen wrongly, so returning you to the 'real' mode 4 screen after you scroll into the start of it. The upshot of this is that you can select other pages of memory for display, but don't scroll the screen. It is alright if you define a text window to occupy the whole new page, since scrolling in a window does not move the VDU RAM around, but it is rather slow.

The application for having more than one page of screen memory that first occured to me was to construct an animation program, which could switch rapidly between two images on different pages, to give the illusion of movement.

You will find that getting mode 7 to display in other pages is often very confusing, and does not work out exactly as planned. I would advise you to steer clear of this activity. The other danger spot occurs when you overwrite your program and a new screen page. Typing CLG will destroy your program.


Locations &322 and &323 -- Address of top left of screen. (16 bits).

LSB MSB


The contents of these two locations in each of the screen modes are as follows:

Mode--01234567
Contents--1228812288122881638422528225282457631744

The contents are the same as in locations &320 and &321. However, as we've already found the start of VDU RAM location, it would be safe to assume that this location contains the address of the top left of the screen. If you scroll the screen a little, and then print the value in these locations, you will find that it has changed, reinforcing this view.

Machine language programmers will find the contents of this location useful, since without it, they would have severe problems POKEing data directly to the screen. For BASIC programmers, any use of this location has been removed by the existing system software.

Altering this location does nothing useful, but is a fairly harmless occupation.


Locations &324 to &325 -- Bytes per line. (16 bits).

LSB MSB


The contents of these two locations in each of the eight screen modes are as follows:

Mode--01234567
Contents--64064064064032032032040

From the values given for modes 0 and 4, you would expect these locations to hold the horizontal graphics resolution in the current screen mode. Form the value given for mode 7, you would be forgiven for thinking that these locations hold the number of characters per line. But if you remember from the last chapter when I said that modes 0 to 3 have 80 characters per line, and modes 4,5 and 6 have 40 characters per line, you should see some pattern in the above values. Also, 20K divided by 32 lines gives 640, and 10K divided by 32 lines gives 320. You may now be able to see why this location contains the number of bytes per line of text. These locations are used, in conjunction with some others, to decide what the graphics resolution of the current screen mode is.

Altering the contents of these locations alters the number of bytes scrolled. Thus, if you execute '?&324=20', while in mode 7, and then try to scroll, you will get some very odd effects. Similarly, in any of the graphics modes, altering the value in these locations gives the computer a funny idea of the resolution of the current mode, and so all plotting looks a little odd. The application of this is that you can alter the number of characters per line, by a method similar to that outlined at the end of the last chapter. These locations go some of the way towards telling the MOS that you have made the alteration. As an example, try this program:

   10 REM Order out of chaos
   20 REM Copyright (C) 1982
   30 REM Jeremy Ruston
   40 MODE 4
   50 REM Kid the system about the
   60 REM graphics resolution...
   70 ?&324=32
   80 REM There are now 288 bytes/line
   90 REM Or 288/8=36 chars/line
  100 FOR T=0 TO 100
  110 DRAW RND(1280)-1,RND(1024)-1
  120 NEXT T
  130 COLOUR 0
  140 COLOUR 129
  150 PRINT ''"Press the space bar"
  160 REPEAT
  170 REPEAT UNTIL GET=32
  180 REM Give the screen 36 chars/line
  190 VDU 23,0,1,36,0,0,0,0,0,0,0
  200 REPEAT UNTIL GET=32
  210 REM And take it back
  220 VDU 23,0,1,40,0,0,0,0,0,0,0,0
  230 UNTIL FALSE



Locations &326 and &327 -- Screen memory length. (16 bits.)

LSB MSB


The contents are as follows:

Mode--01234567
Contents--20480204802048016384102401024081921024

This one is a bit of a cinch. The 1024 for mode 7 and the 20480 for mode 0 give away this as the length of the screen memory.

The value stored here is used when the 6845 is used for scrolling. It contains the number of bytes that can be scrolled before registers 12 and 13 will have to be reset to their starting variables.


Location &328 -- Top right y-coordinate of text window. (8 bits).


This location will always contain zero, unless a text window has been defined, in which case it will contain the last parameter of the VDU 28 statement.

Altering the contents of this location will serve no useful purpose, except save you the trouble of a VDU 28 statement. This is not advisable -- remember the golden rule: only use the indirection operators (?) when you have no other choice.


Location &329 -- Top right x-coordinate of text window. (8 bits).


This location normally contains one less than the number of characters per line in each mode:

Mode--01234567
Contents--7939197939193939

If a text window has been defined, it contains the third parameter of the VDU 28 statement.


Location &32A -- Bottom left y co-ordinate of text window. (8 bits).


This location normally contains the number of lines minus one in the current screen.

Mode--01234567
Contents--3131312431312424

If a text window has been defined, this location contains the second parameter of the VDU 28 statement.


Location &32B -- Bottom left x-coordinate of text window (8 bits).


This location normally contains zero, but after a text window has been defined, it contains the first parameter of the VDU 28 statement.


Location &32C -- Cursor X-coordinate. (8 bits).


This location contains the X--coordinate of the text cursor, from the top left of the screen. Thus, after a CLS or a cursor home, it is initialized to the contents of location &32B. Reading the variable POS gives the value stored here, minus the value stored in location &32B.

Altering this value gives you one way of altering the cursor's position, but there are more elegant ways.


Location &32D -- Cursor Y-coordinate (8 bits)


This location holds the Y-coordinate of the cursor, with reference to the top left of the screen. Thus after a CLS or cursor home it is initialized to the contents of location &328. Reading VPOS gives the value stored here, minus the value in &328.


Locations &32E and &32F -- Cursor address. (16 bits).

LSB MSB


Initially, the contents of this location are:

Mode--01234567
Contents--1228812288122881638422528225282457631744

But, with the program given earlier to list out the contents of memory locations after various windows had been defined, different results were obtained:

Mode--01234567
Contents--1421614224142401831223496235042554431865

So, I was faced with a number which was the top left-hand address of VDU RAM before any text windows were in force, and altered in the presence of a window. I concluded that this was the address of the cursor. Some experimentation proved me right for example, if you execute the statements '?(?&32E+(?&32F)*256)=33' in mode 7, you will be rewarded by seeing an exclamation mark appear on the screen under the line you typed, to be rapidly replaced with the prompt. You can stop the prompt obscuring things by appending the statement 'VDU30' to the end of the instructions. This will return the cursor to the top left-hand corner of the screen, after the initial statement has been executed.


Locations &330 and &331 -- Top right y-coordinate of graphics window. (16 bits).

MSB LSB


The contents of this location in all eight modes are as follows:

Mode--01234567
Contents--108108108108108108108

These two locations first interested me when I was looking for the place where the last argument of the VDU 24 statement was stored. In the program I used to get these figures, given earlier in the chapter, you will recall that the last parameter was the number 432. Thus, I was looking for two locations which collectively contained 432. I was not in luck, so I turned my mind to seeing how else the required information could be stored.

All graphics statements operate on a grid of 1280 by 1024. So the vertical scaling factor was four, since 256 (the vertical resolution in all modes) into 1024 goes four times. So maybe I should look for a location containing 432/4 (108) instead. This I did, and before long came up with these locations. To test this, I checked that these locations contained 255 before a graphics window was created.

The primary use of a location such as this is to be able to see what the size of the current graphics window is, without having to save the required information in variables. I would not recommend altering this location by any other means than the VDU 24 statement, simply to aid readability in your programs. If you ever read this location in a program, I would suggest you use a function like this, for the same reasons:

   10REM A function to read the vertical
   20REM dimensions of the current
   30REM graphics window.
   40REM Copyright (C) Jeremy Ruston
   50MODE 4
   60PRINT 'FNvert
   70PRINT ''"The answer is given as "
   80PRINT '"1020 since it has been "
   90PRINT '"scaled by four."
  100END
 1000DEF FNvert=?(&331)*4



Locations &332 and &333 -- Top right X-coordinate of graphics window. (16 bits). MSB LSB


Using the same program as before, the results obtained were:

Mode--01234567
Contents--2661336666133663366

Remember the order in which the bytes describing the text window are presented, I was expecting to find the top right X-coordinate of the graphics window at these locations. The VDU 24 statement in the program gave this as 532. The horizontal scaling factors for each of the eight modes are as follows:

Mode--01234567
Scaling factor--248X48XX
(X = don't care)

So, 532/2=266,532/4=133 and 532/8=66 (whole number part only). So this location does indeed hold that information, but only in terms of the actual graphics grid of 640 by 256, 320 by 256 or whatever, and not the normal grid of 1280 by 1024.

The same points I made after the last location hold true for this one, with regard to interrogation and alteration.


Locations &334 and &335 -- Bottom right Y-coordinate of graphics window. (16 bits).

MSB LSB


This one was very predictable. The values I found were all 12 (12*4=48, is the nearest number to 50 divisible by four, and 50 is the second parameter in the VDU statement). So this location contains the bottom right Y-coordinate of the current graphics coordinate, in terms of vertical resolution of 256, rather than 1024. The same points about altering and interrogation as made in the discussion of location &330 hold true.


Locations &336 and &337 -- Bottom right X-coordinate of graphics window. (16 bits).

MSB LSB


With the same provisos as mentioned for location &332, this location holds the first parameter of the VDU 24 statement, the bottom right X-coordinate of the current graphics window.

Don't forget about the scaling factors in all the modes.


Locations &338 and &339 -- Y-coordinate of graphics origin. (16 bits).

MSB LSB


In all modes, the program gave the contents of these locations as 490, which I gave as the Y-coordinate of the graphics origin in the VDU 29 statement. Normally this location contains zero, because the origin is at the bottom left-hand corner of the screen.

Altering this location is again pretty pointless, but interrogating it can often be useful. Do remember to use a special function, rather than using the indirection operators directly, if only for reasons of elegance.


Locations &33A and &33B -- X-coordinate of graphics origin. (16 bits).

MSB LSB


These locations contain 500 in all modes, which I gave as the first parameter of the VDU 29 statement in the program. So it contains the X-coordinate of the graphics origin, but without scaling, ie it contains the X-coordinate directly in all modes, not divided by two in mode 0, and 4 in modes 1 and 4.


Locations &33C and &33D -- Current Y-coordinate of graphics cursor. (16 bits).

MSB LSB


These locations contain 421 in all graphics modes, and 50 in the text only modes. The 421 is instantly recognizable as the second coordinate given in the MOVE statement in the program.

I had only found the most recently visited point, I still had to find the point visited before last, which is used by the PLOT 85 routines.

Altering this quantity is easily done by using the MOVE statement, or any other of the PLOT statements. It is often useful to read the current coordinates though, so I suggest you use a function to do this.


Locations &33E and &33F -- Current X-coordinate of graphics cursor. (16 bits).

MSB LSB


In graphics modes, this location contains 234 according to the program given earlier, and 60 in the non-graphics modes. 234 is, of course, the first parameter of the second MOVE statement in the program. As with the previous location, it is initialized to zero at a mode change or CLG.

The points about interrogation and alteration made in the discussion of the previous location hold true for this one as well.


Location &367 -- Current screen mode. (8 bits).


The contents of this location are:

Mode--01234567
Contents--01234567

I need hardly say more.

The location does not seem to affect anything if you alter it, but reading it can be useful, since it is then possible to write a graphics program which the user can start running in whatever mode he or she likes, and the program can see what mode is being used, and scale its output accordingly.


Location &36B -- Flags one. (8 bits).


This location was a pest to work out. It normally contains zero, but when running the program, I found it contained 8. I started looking for something in the program which involved the figure 8, to see what this location was doing. I found nothing, so I resorted to the old and tested method of randomly placing values in the location. I started out by putting the machine in mode 4, and then executing '?&36B=1'. No sooner had I done that then the printer I was using, and had de-selected with CTRL-C, popped into life. It then became obvious that the location contained eight flags, so I began working out what the other flags were for.

The next step was to put two in the location, to test the second bit, and see what happens. This I did, and found out only that the screen refused to scroll, as if it was in VDU 5 mode. It wasn't in VDU 5 mode, because the cursor was still present, and the text colour was still selectable by means of the COLOUR statement. So bit 1 determined whether scrolling was to take place.

Bit 2 was a little easier to discover. I put the computer in page mode, and looked at the contents of the location. I was rewarded by seeing it contained the figure 4.

Bit 3 was difficult, so I just placed the number 8 in &36B, and saw what happened. The screen started scrolling by moving the contents of memory locations. So this was the 'kind of scroll flag' I mentioned at the beginning of the chapter. Try it and see.

Bit 4 does not do anything in the present operating system.

Bit 5 is the joined/separate text/graphics cursor flag. When set to true, VDU 5 mode is active.

Bit 6 appears to be the edit mode on/off flag.

Bit 7 is the VDU driver's disable/enable flag. When set, the VDU drivers are inactive, and will remain so until a VDU 6 instruction is executed, or until the flag is set to zero.

Except for bits 1 and 3, it is easier to set these flags by executing the appropriate VDU commands. However, reading them is feasible and often useful.

Setting bit 1 is useful if you want to print on the bottom line of the screen, since normally the screen has a tendency to scroll if you do this, especially with the bottom right-hand character position.

Setting bit 3 to a full scroll when you have a text window in operation is interesting. Try setting up a text window of just the top left character position, by executing 'VDU 28,0,0,0,0', and then type '?&36B=0'. Then, every time you press a key, the whole screen will roll up, unless you hit CTRL-H, delete or CTRL-K, in which case it will roll down. This is an easier way of rolling than using the 6845's registers and 12 and 13 directly, but does have the disadvantage of leaving a trail of characters up the left most column of the screen. If you just use 'PRINT' to roll the screen, under program control, the problem is moved, except that now, all the text in the left most column of the screen will be cleared.


Location &36D -- CLS/scroll filler byte. (8 bits).


The contents of this location in the eight modes are as follows:

Mode--01234567
Contents--000000032

Go into mode 7, and try typing '?&36D=42', then clear the screen.

This location holds the byte that will be put into every memory location as it is scrolled or cleared. Thus in mode 7, the code for a space, 32, is used, but in other modes, 0 is used since 0 corresponds to a byte completely made up of colour 0, presuming colour 0 is the current background colour.

In one of the modes 0 to 6, try '?&36D=&AA', and then clearing the screen. You should get some sort of stripy background, since the binary of &AA is 10101010. If you alter the background character, the edit keys do not work correctly, or rather the copy key does not. The technique is still useful, for shading if nothing else. In mode 7, you could try typing in response to a program like this:

  10 REM Copyright (C) Jeremy Ruston
  20 REPEAT
  30 ?&36D=GET
  40 CLS
  50 UNTIL FALSE
  60 REM Line 30 could also be :
  70 PRINT TAB(0,24)



Location &36E -- Graphics foreground colour mask. (8 bits).


The program I used to list the content of various memory locations contained the line GCOL 1,4, so when I started to look for the location that held the current graphics colour, I first looked for a location that contained 4 in all modes. But there aren't four colours in all modes. Colour 4 in modes 0 and 4 is in fact the same as colour 0, and in modes 1 and 5 it is the same as colour zero, for a slightly different reason. I therefore started looking for a location containing something like this in all the graphics modes:

Mode--01245
Contents--00400

However, if you look, there is no such location. The alternatives for storing the colour directly are few -- namely a 'colour mask' can be used, as is employed in the Acorn Atom.

A colour mask is a byte equivalent to a byte of the display memory containing just the current colour. Refer back to the description of byte mapping in the previous chapter, and working from those tables, make up a byte of the colour the new graphics foreground colour is to be. You will then have a colour mask for that colour.

For example, in the two colour modes, a mask for colour 0 is a byte containing zero, and the mask for colour one is a byte containing 255. The best way to see this is to examine masks that the computer makes up for you. You do this by changing the graphics foreground colour to the desired colour, and then the contents of &36E is the mask for that colour.

A little bit of experimentation (ie making up colour masks by hand and then looking for them) showed that the graphics foreground mask is stored at address &36E.

The computer uses the mask in combination with some boolean operations to speed up the plotting operation, the exact process of which is irrelevant.

Reading the current foreground colour from this location is a tiresome business, but here are some routines to do it:

   10 REM GCOL 0,X read function
   20 REM Use the one appropriate to
   30 REM your current mode.
 1000 DEF FNtwo_colour_modes=?&36E AND 1
 2000 DEF FNfour_colour_modes=(?&36E AND 1)+(?&36E AND 16)/8
 3000 DEF FNmode_two LOCAL T,B
 3010 FOR T=0 TO 6 STEP 2
 3020 IF (2^T AND ?&36E)=2^T THEN B=B+2^
(T/2)
 3030 NEXT T
 3040=B


Altering this location is great fun. For example, this program gives you striped text, by setting the graphics foreground mask, and then printing under the influence of VDU 5.

   10 MODE 5
   20 ?&36E=&5A
   30 VDU 5
   40 PRINT'''"There's a lady who's sure
 all that glit-ters is gold"'
   50 PRINT "And she's buying a  stairwa
y to heaven.."
   60 VDU 4
   70 END



Location &36F -- Graphics background colour mask. (8 bits).


This location is the exact opposite of location &36E, in that it determines the current graphics background colour, rather than the current foreground colour. The format of the location is exactly the same, and it can be read from using the same routines as location &36E, except you'll have to change every occurence of &36E to &36F.
The application of this location is to enable you to fill whole areas of the screen with a striped pattern. In the same way as you fill in rectangles at the moment, using VDU 24, followed by GCOL. Just set the background colour mask beforehand to a striped pattern, and you'll have a striped rectangle.


Location &370 -- Graphics foreground modifier. (8 bits).


This location contains the first parameter of the most recent GCOL statement setting the graphics foreground colour. There's not much you can usefully do with it, except possible read it. If you set it to an out-of-range value, ie 5 or above, you get some pretty weird results with your next plot, but there again, why not just make the first parameter of the GCOL statement out of range?


Location &371 -- Graphics background modifier. (8 bits).


When George Mikas wrote his definitive 'How to be an Alien', which describes in great detail the shortcomings of the British, through the eyes of a foreigner, the chapter entitled 'Sex' contained just the following words: "On the continent they have sex; the British have hot water bottles." The chapter has come in for a little criticism since then.

The point of all this is that I can find as little to write about with reference to this location as George Mikas could about the Great British sex life.


Location &375 -- Colours available. (8 bits).


This location contains one less than the number of colours available in the current mode, except for mode 7, where it contains zero. Thus its contents in the eight modes are as follows:

Mode--01234567
Contents--131511310

The effect of altering this register is dramatic. If you increase it to the maximum of 15 in any mode other than 2 and 7, you'll get rather big writing. This technique is not perfect, since the letters overlap. I'll show you a better program in a few pages.

An odd thing is that after altering this register, to get VDU 19 working correctly, you'll find you have to alter the colour of two of the logical colours to get any proper change in colour of a single actual colour.


Location &376 -- Bytes per character. (8 bits).


This location holds the number of bytes that separate the top of one character from the bottom of the next. Its contents in the eight modes are as follows:

Mode--01234567
Contents--81632881681

In mode 7, typing '?&376=2' will space out the text you type across the line by a factor of two. The trouble is, when the computer reaches the end of a screen line, it doesn't quite know where to go next, since it is sure there are 40 characters to every line, but it's only managed to fit 20 on. So the remedy is to tell it that there are now only 20 characters on the each screen line. Rather than setting up a text window, try using '?&329=19' to set the right-hand margin to 19. This will ensure that normal 6845 scrolling is carried out, even though there is a screen window. In other modes, you can get pretty overlapping text by reducing the number normally held in this location. Not altogether useful.

Here is the 'funny writing' program, properly debugged:

   10 REM Funny writing
   20 REM Copyright (C) 1982
   30 REM Jeremy Ruston
   40 MODE 0
   50 ?&375=15
   60 ?&376=32
   70 ?&377=1
   80 ?&329=19
   90 PRINT TAB(0,13);
  100 PROCCENTRE("T H E")
  110 PRINT
  120 PROCCENTRE("B B C")
  130 PRINT
  140 PROCCENTRE("M I C R O")
  150 PRINT
  160 PROCCENTRE("R E V E A L E D")
  170 PRINT
  180 END
  190 DEF PROCCENTRE(A$)
  200 PRINT TAB(10-LEN(A$)/2);A$
  210 ENDPROC



Location &377 -- Pixels per byte. (8 bits).


This location contains zero in the non graphics modes, and the number of pixels per byte minus one in the other modes. Thus its contents in the eight modes are as follows:

Mode--01234567
Contents--73107300

The data stored here is used only in graphics commands. Altering it just causes some bizarre effects without doing anything useful.

It is possible to use this location in conjunction with a couple of those we've already discussed to work out the graphics resolution of the current mode, bearing in mind that the vertical resolution is constant at 256 for all modes.


Location &37E --
Perma-edit. (8 bits).


This location normally contains 13, but I found that if you load 127 into it, you can stop the computer dropping you out of edit mode at every carriage return. I use this feature when I am copying a number of lines from the top of the screen to the bottom, since it allows me to dispense with moving the cursor back up the screen to start copying each new line.


Location &382 -- Define flags. (8 bits).


These flags affect whether a RAM-based, or ROM-based character generator shall be used for a particular set of characters. If any of the bits indicated below are set to '1', the corresponding region of the character set will be read from RAM, else from ROM.

The bits control the following section of the set:

BitROM locationRAM locationCharacter range
0--&C00 to &CFF224--255
1--&1000 to &10FF192--223
2--&1100 to &11FF160--191
3--&1200 to &12FF128--159
4&C200 to &C2FF&1300 to &13FF 96--127
5&C100 to &C1FF&1400 to &14FF 64-- 95
6&C000 to &C0FF&1500 to &15FF 32-- 63

If the later portion of the character set, ie that from 128 to 255, is set to a ROM-based character generator, it takes the normal ASCII set as its starting point, but displaced by 128.

The advantage of this location is that by setting it to zero you can undo all the re-defining you have done, which is just not possible with the present ROM revision normally.

On the subject of the character generator, here is a routine to print out the entire character set, eight times the normal size.

  10 MODE 7
  20 FOR T%=&C000 TO &C2FF
  30 IF (T%-&C000) MOD 8=0 THEN
     PRINT "--------"
  40 FOR A%=7 TO 0 STEP -1
  50 IF (2^A% AND ?T%)=2^A%
     THEN VDU 255 ELSE VDU 32
  60 NEXT A%
  70 PRINT
  80 NEXT T%



Location &D8 -- Caps lock/shift lock. (8 bits).


This location contains 32 when caps lock is active, 16 when shift lock is active and 48 when neither are active. It is also possible to set the location from BASIC to simulate the pressing of the required key, but for some weird reason a character 13 has to be printed before the relevant lights are lit.

The application of this would be to ensure that the user of a program only typed in upper or lower case by setting the contents of &D8 before the INPUT statement is executed.

Under some more peculiar conditions, this location can be used to sense whether control or shift are active, but I would recommend using INKEY with a negative argument to achieve the same result.


Locations &38A to &399 -- Current palette. (16 bytes).


These locations hold the actual colour of each of the 16 logical colours. Thus the actual of colour zero is stored in address &38A, the actual colour of colour 1 in address &38B and so on up to the actual colour of logical colour 15 being stored in location &399. Obviously only mode 2 uses all the locations. The sample run shows the default settings of this table, but remember that only the first two or four numbers are significant in the majority of modes. The contents of the table can be altered with VDU 19, which also changes the colours on the screen.

Altering this table has no effect at all. Reading from it can be useful in a lot of cases. For example, this routine calls up mode 4, and then chooses random background and foreground colours, but uses this table to ensure that the colours are never the same.

   10 MODE 4
   20 VDU 19,0,RND(8)-1,0,0,0
   30 REPEAT
   40 VDU 19,1,RND(8)-1,0,0,0
   50 UNTIL ?&38B<>?&38A


You can get a similar effect by using one of the MOS calls detailed in the User Guide.


The remaining two areas
of interest are buffers:

Buffers are used to store data between being processed by some peripheral and being read by the computer, or the other way round. For example, most printers print characters at around 100 characters per second. The computer can print characters at a far greater sped, however. To stop the computer being constantly tied up with sending characters to the printer, it stores characters in a temporary storage area, the buffer, if the printer is not ready to accept the characters. They can be sent to the printer when the computer receives word that it is ready. If the buffer does ever get filled up, the computer's operation is suspended, until it can empty the buffer.

The keyboard buffer is used to stored characters issued when the computer is to busy to process them, so it, in effect, operates as the exact complement of the Centronics buffer.

The Centronics (R) buffer starts at address &3A0 and extends to address &3DF.

The run time keyboard buffer starts at address &3E0 and finishes at address &3FF. The contents of address &23C hold the next free location in the buffer, minus &300. When the pointer gets past 255, it reverts to 224, the decimal equivalent of &E0. Thus to insert a character into the buffer, you need only put the character in the address given by &300 plus the contents of &23C then increment the contents of &23c, remembering to reset it to 224, if it passes 255.

This program shows how to do it:

   10 DIM START 200
   20 REM This program dumped itself on
   30 REM the printer.
   40 PROCKEY(0,"WIDTH 40 |M |B LIST |M 
|C WIDTH 0 |M")
   50 PROCADD(CHR$(144))
   60 END
 1000 DEF PROCADD(A$)
 1010 LOCAL B$,T,A
 1020 IF LEN(A$)>32 THEN ENDPROC
 1030 FOR T=1 TO LEN(A$)
 1040 B$=MID$(A$,T,1)
 1050 A=?&23C
 1060 ?(&300+A)=ASC(B$)
 1070 A=A+1
 1080 IF A>255 THEN A=224
 1090 ?&23C=A
 1100 NEXT T
 1110 ENDPROC
 2000 DEF PROCKEY(N,A$)
 2010 $START="*KEY "+STR$(N)+CHR$(34)+A$
+CHR$(34)
 2020 X%=START MOD 256
 2030 Y%=START DIV 256
 2040 CALL &FFF7
 2050 ENDPROC


PROCADD will add the characters in A$ to the buffer. When a program returns to an INPUT statement, or ends the characters in the buffer will be used as input, as if they had been typed in at the keyboard. The example program uses this feature to list itself out on the printer.

The disadvantage of PROCADD is that it only works with 32 characters, which is a little restrictive, so I have defined a procedure to define a key with a BASIC string, to make up for *KEY 0 A$ being illegal. Then the code for function key 0 can be put into the buffer, and it only takes up a single character. The function keys have codes from 144 to 154. The cursor control keys and the copy keys are stored in the buffer using the same codes as they generate under *FX4,1.

Try replacing the text in line 40 with anything else, and see what happens. Don't forget that you'll lose any previous text stored under key zero.

At the beginning of the chapter, I listed the current text colour as something to find the region &300 to &3FF. After research, you'll find that the current text colour is not stored in this area -- this can be verified by using this program.

   10 MODE 5
   20 COLOUR 2
   30 COLOUR 128+1
   40 PRINT "COLOUR 2"
   50 DIM M% 255
   60 FOR T%=0 TO 255
   70 M%?T%=T%?&300
   80 NEXT T%
   90 MODE 5
  100 PRINT "COLOUR 2 ?"
  110 FOR T%=0 TO 255
  120 T%?&300=T%?M%
  130 NEXT T%


The program takes you into mode 5, sets the text background and foreground colours and then takes you back into mode 5. After the text colour is set, the contents of memory from &300 to &3FF is stored, and then these values are written back after the mode is changed back to five. You will find that even though the contents of &300 to &3FF are identical in both cases, the text colour is different.

Having established that I had to look elsewhere I used the routine given in section one to make mode 0 VDU RAM start at address zero. Then I made various changes to the text background and foreground colours, and looked around for the locations affected. Having a video monitor, I could locate these locations easily. They were &CD and &CE. As they are zero page locations, they are quick to access in machine code, so it shows how much Acorn wanted to optimize the speed of text printing. It might have been a good idea to have stored the graphics background and foreground colours in page zero as well, since it is just as important to speed up the graphics routines as the text.

The next stage was to work out how these locations held the colours.

I used this program to list out the contents of these locations under various colour combinations, in a four colour mode, mode 5:

   10 MODE 5
   20 FOR FRONT=0 TO 3
   30 FOR BACK=0 TO 3
   40 COLOUR FRONT
   50 COLOUR BACK+128
   60 PRINT "FRONT=";FRONT,"BACK=";BACK;
   70 PRINT ?&CD,?&CE
   80 NEXT BACK
   90 NEXT FRONT
  100 END
 RUN
FRONT=0   BACK=0       255          255
FRONT=0   BACK=1       240          255
FRONT=0   BACK=2        15          255
FRONT=0   BACK=3         0          255
FRONT=1   BACK=0       240          240
FRONT=1   BACK=1       255          240
FRONT=1   BACK=2         0          240
FRONT=1   BACK=3        15          240
FRONT=2   BACK=0        15           15
FRONT=2   BACK=1         0           15
FRONT=2   BACK=2       255           15
FRONT=2   BACK=3       240           15
FRONT=3   BACK=0       255            0


The program will only work if you've got a printer, because it involves printing in colour 1 on a colour 129 background, which is, of course, unreadable.

You might have been expecting the two locations to be colour masks for the background and foreground colours. The above table will tell you that that is not the case. In addition, altering location &CE alters both the foreground and background colours, as you can easily verify.

There does not appear to be any recognizable pattern in the values, so I resorted to an old trick of displaying everything in binary. The program and printout appear as:

   10 MODE 5
   20 FOR BACK=0 TO 3
   30 FOR FRONT=0 TO 3
   40 COLOUR FRONT
   50 COLOUR BACK+128
   60 PRINT "BACK=";FNB2(BACK),"FRONT=";
FNB2(FRONT);
   70 PRINT ,FNBIN(?&CD),FNBIN(?&CE)
   80 NEXT FRONT
   90 NEXT BACK
  100 END
  110 DEF FNB2(A)
  120 LOCAL T,B$
  130 FOR T=1 TO 0 STEP -1
  140 IF (2^T AND A)=2^T THEN B$=B$+"1" 
ELSE B$=B$+"0"
  150 NEXT T
  160 =B$
  170 DEF FNBIN(A)
  180 LOCAL B$,T
  190 FOR T=7 TO 0 STEP -1
  200 IF (2^T AND A)=2^T THEN B$=B$+"1" 
ELSE B$=B$+"0"
  210 NEXT T
  220 =B$
>RUN
BACK=00   FRONT=00  11111111  11111111
BACK=00   FRONT=01  11110000  11110000
BACK=00   FRONT=10  00001111  00001111
BACK=00   FRONT=11  00000000  00000000
BACK=01   FRONT=00  11110000  11111111
BACK=01   FRONT=01  11111111  11110010
BACK=01   FRONT=10  00000000  00001111
BACK=01   FRONT=11  00001111  00000000
BACK=10   FRONT=00  00001111  11111111
BACK=10   FRONT=01  11111111  00001111
BACK=10   FRONT=10  00000000  11110000
BACK=10   FRONT=11  11110000  00000000
BACK=11   FRONT=00  00000000  11111111
BACK=11   FRONT=01  00001111  11110000
BACK=11   FRONT=10  11110000  00001111
BACK=11   FRONT=11  11111111  00000000


Again, this program does not run too well if you don't have a printer. You could, however, store all results in an array, and then display them in mode 7 to make up for this deficiency.

The third column of the printout is the contents of &CD, and the next is the contents of &CE. At this point, it would be helpful to reproduce the colour masks of colours 0 to 3 (these are for the four colour modes):

COLOUR 0   00000000
COLOUR 1   00001111
COLOUR 2   11110000
COLOUR 3   11111111

You will notice that the contents of location &CE is the inverse of the foreground colour mask. After a little thought, you may notice that the contents of location &CD is NOT (foreground mask EOR background mask). This may sound a complicated arrangement, but it only means that where a bit of the foreground is '1' and the same bit of the background mask is '0', the same bit in &CD is '0'. If, however, the two bits of the mask are the same (ie both '1's or both '0's), the same bit in &CD will be a '1'.

Thus, the computer is free to use the foreground mask almost as it stands, but to get the background mask, it has to use the contents of &CD (EOR) and the contents of &CE'.

The same is true for the two and 16 colour modes, except of course the number of pixels controlled by each byte is different.

If you use this location to get striped text, without recourse to VDU 5 mode, remember that you'll also have to alter location &36D, to be the background colour mask, to ensure that when you scroll the screen, or clear it, it clears to whatever pattern you chose.

Whilst trying to design envelopes, you may find that your best one has been lost, by being scrolled off the screen as you type the SOUND statements to test it. This program allows you to recall from memory any of the four envelopes.

   10 REM Envelope recall
   20 REM (C) Jeremy Ruston 1982
   30 REM ----------------------
   40 INPUT "Enter the number of the ENV
ELOPE "NUM
   50 @%=0
   60 PRINT "The envelope is:"
   70 PRINT "ENVELOPE ";NUM;
   80 FOR T=0 TO 12
   90 PRINT ",";?(&800+NUM*16+T);
  100 NEXT T
  110 PRINT
  120 @%=10



|300 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|301 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|302 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|303 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|304 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|305 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|306 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|307 |  25  25  25  25  25  25  25  25 |
|                                      |
----------------------------------------
|308 |   0   0   0   0   0   0   0   0 |
|                                      |
----------------------------------------
|309 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|30A | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|30B | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|30C | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|30D | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|30E | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|30F | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|310 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|311 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|312 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|313 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|314 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|315 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|316 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|317 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|318 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|319 | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|31A | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|31B | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|31C | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|31D | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|31E | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|31F | 255 255 255 255 255 255 255 255 |
|                                      |
----------------------------------------
|320 |   0   0   0   0   0   0   0   0 |
|LSB Screen memory start                  |
----------------------------------------
|321 |  48  48  48  64  88  88  96 124 |
|MSB Screen memory start                  |
----------------------------------------
|322 |   0   0   0   0   0   0   0   0 |
|LSB Address of top left of screen        |
----------------------------------------
|323 |  48  48  48  64  88  88  96 124 |
|MSB Address of top left of screen        |
----------------------------------------
|324 | 128 128 128 128  64  64  64  40 |
|LSB Bytes per line (whole screen)        |
----------------------------------------
|325 |   2   2   2   2   1   1   1   0 |
|MSB Bytes per line (whole screen)        |
----------------------------------------
|326 |   0   0   0   0   0   0   0   0 |
|LSB Screen memory length                 |
----------------------------------------
|327 |  80  80  80  64  40  40  32   4 |
|LSB Screen memory start                  |
----------------------------------------
|328 |   3   3   3   3   3   3   3   3 |
|Y-coord of top right of text window      |
----------------------------------------
|329 |  17  17  17  17  17  17  17  17 |
|X-coord of top right of text window      |
----------------------------------------
|32A |  20  20  20  20  20  20  20  20 |
|Y-coord of bottom left of text window    |
----------------------------------------
|32B |   1   1   1   1   1   1   1   1 |
|X-coord of bottom left of text screen    |
----------------------------------------
|32C |   1   1   1   1   1   1   1   1 |
|Cursor X displacement from top left      |
----------------------------------------
|32D |   3   3   3   3   3   3   3   3 |
|Cursor Y displacement from top left      |
----------------------------------------
|32E | 136 144 160 136 200 208 200 121 |
|LSB Cursor address                       |
----------------------------------------
|32F |  55  55  55  71  91  91  99 124 |
|MSB Cursor address                       |
----------------------------------------
|330 |   0   0   0   0   0   0   0   0 |
|MSB Top right y-coord of graphics window   |
----------------------------------------
|331 | 108 108 108 108 108 108 108 108 |
|LSB Top right y-coord of graphics window   |
----------------------------------------
|332 |   1   0   0   0   0   0   0   0 |
|MSB Graphics window top right x-coord    |
----------------------------------------
|333 |  10 133  66  66 133  66  33  66 |
|LSB Graphics window top right x-coord    |
----------------------------------------
|334 |   0   0   0   0   0   0   0   0 |
|MSB Graph. wind. bot. right y-coord      |
----------------------------------------
|335 |  12  12  12  12  12  12  12  12 |
|LSB Graph. wind. bot. right y-coord      |
----------------------------------------
|336 |   0   0   0   0   0   0   0   0 |
|MSB Graph. wind. bot. right. x-coord     |
----------------------------------------
|337 |  30  15   7   7  15   7   3   7 |
|LSB Graph. wind. bot. right x-coord      |
----------------------------------------
|338 |   1   1   1   1   1   1   1   1 |
|MSB Y-coord of graphics origin           |
----------------------------------------
|339 | 234 234 234 234 234 234 234 234 |
|LSB Y-coord of graphics origin           |
----------------------------------------
|33A |   1   1   1   1   1   1   1   1 |
|MSB X-coord of graphics origin           |
----------------------------------------
|33B | 244 244 244 244 244 244 244 244 |
|LSB X-coord of graphics origin           |
----------------------------------------
|33C |   1   1   1   0   1   1   0   0 |
|MSB Current y-coord graphics cursor      |
----------------------------------------
|33D | 165 165 165  50 165 165  50  50 |
|LSB Current y-coord graphics cursor      |
----------------------------------------
|33E |   0   0   0   0   0   0   0   0 |
|MSB Current x-coord graphics cursor      |
----------------------------------------
|33f | 234 234 234  60 234 234  60  60 |
|LSB Current x-coord graphics cursor      |
----------------------------------------
|340 |   0   0   0   0   0   0   0   0 |
|                                      |
----------------------------------------
|341 | 227 227 277 135 227 277 135 135 |
|                                      |
----------------------------------------
|342 |   1   0   0   0   0   0   0   0 |
|                                      |
----------------------------------------
|343 | 111 183  91  70 183  91  35  70 |
|                                      |
----------------------------------------
|344 |   1   1   1   1   1   1   1   1 |
|                                      |
----------------------------------------

|345 | 234 234 234 234 234 234 234 234 | | | ---------------------------------------- |346 | 1 1 1 1 1 1 1 1 | | | ---------------------------------------- |347 | 244 244 244 244 244 244 244 244| | | ---------------------------------------- |348 | 4 4 4 4 4 4 4 4 | | | ---------------------------------------- |349 | 12 12 12 12 12 12 12 12 | | | ---------------------------------------- |34A | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |34B | 30 15 7 7 15 7 3 7 | | | ---------------------------------------- |34C | 4 4 4 4 4 4 4 4 | | | ---------------------------------------- |34D | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |34E | 86 86 86 86 86 86 86 86 | | | ---------------------------------------- |34F | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |350 | 61 30 15 15 30 15 15 15 | | | ---------------------------------------- |351 | 254 254 254 254 254 254 254 254 | | | ---------------------------------------- |352 | 130 130 130 130 130 130 130 130 | | | ---------------------------------------- |353 | 254 254 254 254 254 254 254 254 | | | ---------------------------------------- |354 | 40 40 40 40 40 40 40 40 | | | ---------------------------------------- |355 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |356 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |357 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |358 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |359 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |35A | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |35B | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |35C | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |35D | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |35E | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |35F | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |360 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |361 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |362 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |363 | 141 141 141 141 141 141 141 141 | | | ---------------------------------------- |364 | 218 218 218 218 218 218 218 218 | | | ---------------------------------------- |365 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |366 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |367 | 0 1 2 3 4 5 6 7 | |Current screen mode    | ---------------------------------------- |368 | 0 0 0 1 2 2 3 4 | | | ---------------------------------------- |369 | 136 16 32 136 136 16 136 17 | | | ---------------------------------------- |36A | 0 1 2 0 0 1 0 0 | | | ---------------------------------------- |36B | 8 8 8 8 8 8 8 8 | |See text    | ---------------------------------------- |36C | 255 255 15 255 255 255 255 255 | | | ---------------------------------------- |36D | 0 240 12 0 0 240 0 32 | |CLS/scroll filler byte    | ---------------------------------------- |36E | 0 0 48 0 0 0 0 255 | |Graphics foreground mask    | ---------------------------------------- |36F | 255 15 51 255 255 15 255 0 | |Graphics background mask    | ---------------------------------------- |370 | 1 1 1 1 1 1 1 1 | |Graphics foreground mofidier    | ---------------------------------------- |371 | 4 4 4 4 4 4 4 4 | | | ---------------------------------------- |372 | 196 196 196 196 196 196 196 196 | | | ---------------------------------------- |373 | 201 201 201 201 201 201 201 201 | | | ---------------------------------------- |374 | 103 103 103 103 103 103 103 114 | | | ---------------------------------------- |375 | 1 3 15 1 1 3 1 0 | |Colours availabke    | ---------------------------------------- |376 | 8 16 32 8 8 16 8 1 | |Bytes per character    | ---------------------------------------- |377 | 7 3 1 0 7 3 0 0 | |Pixels per byte    | ---------------------------------------- |378 | 0 0 0 0 0 0 0 0 | | | ---------------------------------------- |379 | 128 136 170 128 128 136 128 128 | | | ---------------------------------------- |37A | 1 17 85 1 1 17 1 1 | | | ---------------------------------------- |37B | 0 0 0 0 0 0 0 0 | | | ----------------------------------------


|37C | 48 48 48 48 48 48 48 48 | | | ---------------------------------------- |37D | 27 27 27 27 27 27 27 27 | | | ---------------------------------------- |37E | 13 13 13 13 13 13 13 13 | |Edit mode    | ---------------------------------------- |37F | 127 127 127 127 127 127 127 127 | | | ---------------------------------------- |380 | 127 127 127 127 127 127 127 127 | | | ---------------------------------------- |381 | 197 197 197 197 197 197 197 197 | | | ---------------------------------------- |382 | 15 15 15 15 15 15 15 15 | |See text    | ---------------------------------------- |383 | 21 21 21 21 21 21 21 21 | | | ---------------------------------------- |384 | 20 20 20 20 20 20 20 20 | | | ---------------------------------------- |385 | 19 19 19 19 19 19 19 19 | | | ---------------------------------------- |386 | 18 18 18 18 18 18 18 18 | | | ---------------------------------------- |387 | 17 17 17 17 17 17 17 17 | | | ---------------------------------------- |388 | 16 16 16 16 16 16 16 16 | | | ---------------------------------------- |389 | 12 12 12 12 12 12 12 12 | | | ---------------------------------------- |38A | 0 0 0 0 0 0 0 0 | |Start of pallette    | ---------------------------------------- |38B | 7 1 1 7 7 1 7 7 | | | ---------------------------------------- |38C | 3 3 2 2 2 3 3 3 | | | ---------------------------------------- |38D | 7 7 3 3 3 7 7 7 | | | ---------------------------------------- |38E | 4 4 4 4 4 4 4 4 | | | ---------------------------------------- |38F | 5 5 5 5 5 5 5 5 | | | ---------------------------------------- |390 | 6 6 6 6 6 6 6 6 | | | ---------------------------------------- |391 | 7 7 7 7 7 7 7 7 | | | ---------------------------------------- |392 | 8 8 8 8 8 8 8 8 | | | ---------------------------------------- |393 | 9 9 9 9 9 9 9 9 | | | ---------------------------------------- |394 | 10 10 10 10 10 10 10 10 | | | ---------------------------------------- |395 | 11 11 11 11 11 11 11 11 | | | ---------------------------------------- |396 | 12 12 12 12 12 12 12 12 | | | ---------------------------------------- |397 | 13 13 13 13 13 13 13 13 | | | ---------------------------------------- |398 | 14 14 14 14 14 14 14 14 | | | ---------------------------------------- |399 | 15 15 15 15 15 15 15 15 | |End of pallette    | ---------------------------------------- |39A | 255 255 255 255 255 255 255 255 | | | ---------------------------------------- |39B | 255 255 255 255 255 255 255 255 | | | ---------------------------------------- |39C | 255 255 255 255 255 255 255 255 | | | ---------------------------------------- |39D | 255 255 255 255 255 255 255 255 | | | ---------------------------------------- |39E | 255 255 255 255 255 255 255 255 | | | ---------------------------------------- |39F | 255 255 255 255 255 255 255 255 | | | ---------------------------------------- |3A0 | 45 45 45 45 45 45 45 45 | |Start of printer buffer    | ---------------------------------------- |3A1 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3A2 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3A3 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3A4 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3A5 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3A6 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3A7 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3A8 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3A9 | 13 13 13 13 13 13 13 13 | | | ---------------------------------------- |3AA | 124 124 124 124 124 124 124 124 | | | ---------------------------------------- |3AB | 51 51 51 51 51 51 51 51 | | | ---------------------------------------- |3AC | 48 48 48 48 48 48 48 48 | | | ---------------------------------------- |3AD | 51 51 51 51 51 51 51 51 | | | ---------------------------------------- |3AE | 32 32 32 32 32 32 32 32 | | | ---------------------------------------- |3AF | 124 124 124 124 124 142 124 124 | | | ---------------------------------------- |3B0 | 32 32 32 32 32 32 32 32 | | | ---------------------------------------- |3B1 | 50 50 50 50 50 50 50 50 | | | ---------------------------------------- |3B2 | 53 53 53 53 53 53 53 53 | | | ---------------------------------------- |3B3 | 53 53 53 53 53 53 53 53 | | | ---------------------------------------- |3B4 | 32 32 32 32 32 32 32 32 | | | ---------------------------------------- |3B5 | 50 50 50 50 50 50 50 50 | | | ---------------------------------------- |3B6 | 53 53 53 53 53 53 53 53 | | | ---------------------------------------- |3B7 | 53 53 53 53 53 53 53 53 | | | ---------------------------------------- |3B8 | 32 32 32 32 32 32 32 32 | | | ---------------------------------------- |3B9 | 50 50 50 50 50 50 50 50 | | | ---------------------------------------- |3BA | 53 53 53 53 53 53 53 53 | | | ---------------------------------------- |3BB | 53 53 53 53 53 53 53 53 | | | ---------------------------------------- |3BC | 32 32 32 32 32 32 32 32 | | | ---------------------------------------- |3BD | 50 50 50 50 50 50 50 50 | | | ---------------------------------------- |3BE | 53 53 53 53 53 53 53 53 | | | ---------------------------------------- |3BF | 53 53 53 53 53 53 53 53 | | | ---------------------------------------- |3C0 | 13 13 13 13 13 13 13 13 | | | ---------------------------------------- |3C1 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3C2 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3C3 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3C4 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3C5 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3C6 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3C7 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3C8 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3C9 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3CA | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3CB | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3CC | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3CD | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3CE | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3CF | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D0 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D1 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D2 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D3 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D4 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D5 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D6 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D7 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D8 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3D9 | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3DA | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3DB | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3DB | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3DC | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3DD | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3DE | 45 45 45 45 45 45 45 45 | | | ---------------------------------------- |3DF | 45 45 45 45 45 45 45 45 | |End of printer buffer    | ---------------------------------------- |3E0 | 135 135 135 135 135 135 135 135 | |Start of run time keyboard buffer    | ---------------------------------------- |3E1 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3E2 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3E3 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3E4 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3E5 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3E6 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3E7 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3E8 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3E9 | 13 13 13 13 13 13 13 13 | | | ---------------------------------------- |3EA | 82 82 82 82 82 82 82 82 | | | ---------------------------------------- |3EB | 85 85 85 85 85 85 85 85 | | | ---------------------------------------- |3EC | 78 78 78 78 78 78 78 78 | | | ---------------------------------------- |3ED | 13 13 13 13 13 13 13 13 | | | ---------------------------------------- |3EE | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3EF | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3F0 | 127 127 127 127 127 127 127 127 | | | ---------------------------------------- |3F1 | 127 127 127 127 127 127 127 127 | | | ---------------------------------------- |3F2 | 51 51 51 51 51 51 51 51 | | | ---------------------------------------- |3F3 | 57 57 57 57 57 57 57 57 | | | ---------------------------------------- |3F4 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3F5 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3F6 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3F7 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3F8 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3F9 | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3FA | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3FB | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3FC | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3FD | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3FE | 135 135 135 135 135 135 135 135 | | | ---------------------------------------- |3FF | 135 135 135 135 135 135 135 135 | |End of run time keyboard buffer    | ----------------------------------------