The monitor ROM reserves 256 bytes from addresses 2000 to 20FF (on MO machines) for its own use. If you want to erase this area, you must keep interrupt disabled, and you won't be able to use SWI calls anymore.
This allows the BASIC editor to work with lines longer than 40 characters. For each of the 24 lines on screen, its actual length (which may be more than 40 chars) is stored. When you press the ENT key, the line under the cursor is scanned using this length information. When using the DEL and INS keys, this is used to know how much characters to shift.
Points to the current line terminator (?)
From 0 to 39.
From 0 to 24.
This value is always 0. This is apparently used when clearing other stuff, in order to not need an extra CPU register to store a 0.
Select the color used when drawing.
This can be a value from -16 to 15. If positive, the color will be set as the character color for the affected cell, and the pixel will be set to 1. If negative, the color will be set as the background color, and the pixel set to 0.
Defines the currently active text attributes:
Store foreground and background colors in the same format as the attribute RAM. Used by PUTCH.
Setting this to 1 disables screen scrolling and uses page mode (printing after line 25 goes back to line 0).
Setting this to 255 enables smooth pixel-scrolling.
Remembers that the cursor is on the last screen-line of a logical line. Do not link that logical line with the next one when the cursor is moved away.
Holds ASCII code of the character under the cursor.
Decremented by interrupts, when it reaches 0, the cursor state is changed.
General looping interrupt counter. Incremented by 50Hz interrupt.
Set by all drawing routines to the current pen position. Used when drawing lines as the 'from' point.
Used as the character to use for drawing routines:
Set by GETCH to the pressed key keycode.
Note length multiplier
Note length
Sound wave shape (values from 0 to 5)
Note octave multiplier (16, 8, 4, 2, 1, from bass to treble)
Note: this needs a tape drive.
Byte being read or written to tape
Byte counter for current block being written to tape
Note: this needs a printer port, which is an extension on some machines.
Used as temporary storage by various routines.
S register is saved here when a routine needs to modify it.
These variables are only used by the floppy controller ROM, not the monitor one.
Used by DKCONT system call. Possible operations:
Some of these can be combined (88 is “write and verify sector”).
This is a 16 bit variable because of the use on QDD as the “LBA” block number.
The default is 7, which lays out the sectors in this order: 0,7,14,6,13,5,12,4,11,3,10,2,9,1,8
Used as error bits after executing disk operations:
Used as information about the type of controller after initialisation:
Pointer to 256 byte work buffer for the floppy controller
Used for several different purposes by the floppy ROM.
This is used as state saving for the screen display state machine. In particular, it allows rendering of multi-byte accented characters.
Temporary parameter storage for US escape sequences
Temporary storage for multi-byte accented characters
Screen State machine temporary storage. These store the two parameters for multi-byte accent sequences.
This points to the table of system calls used by the SWI handler. Modifying this value allows redirecting the handlers for your own use.
This points to a routine to be called on every interrupt.
Set to a non-zero value to re-route the IRQ handler using the IRQPT below
Pointer to a routine to call on interrupt when SEMIRQ is set.
Pointer to a routine to call on FIRQ. This is either the lightpen scan, or the barcode reader.
Pointer to keyboard decoding table (used by GETCH)
Pointer to user characters for codes 128-255.
Pointer to characters for codes 32-127. Characters are stored bottom to top.
Control char to send to printer to switch to graphic mode.
Lightpen calibration offset
Default density for current floppy controller.
Set to FF if there is a floppy controller connected.
These are not used for anything in the ROM, but the software provided with the RF57 serial extension uses this area.
The stack grows downwards.
Working area for the lightpen reading code.
This is set on first boot after the direct-page has been initialized. The Reset handler checks for this, and doesn't repeat all initializations (memory clearing, etc) if this is the case.