These system variables are used in the NC100 Notepad, and it is assumed that they are also used for the NC150 and NC200 machines.
| Address |
Name |
Size |
Comments |
| &B000 |
copyofmmu0 |
&01 |
copy of MMU0 since it's a write-only port. |
| &B001 |
copyofmmu1 |
&01 |
copy of MMU1 since it's a write-only port. |
| &B002 |
copyofmmu2 |
&01 |
copy of MMU2 since it's a write-only port. |
| &B003 |
copyofmmu3 |
&01 |
copy of MMU3 since it's a write-only port. |
| &B004 |
gotcontext |
&01 |
|
| &B005 |
__savepearlmmu |
&01 |
Extra variables needed in case not saving context. |
| &B006 |
__saveaf |
&02 |
|
| &B008 |
__savehl |
&02 |
|
| &B00A |
saveaf |
&02 |
To save context, save all the registers... |
| &B00C |
savebc |
&02 |
|
| &B00E |
savede |
&02 |
|
| &B010 |
savehl |
&02 |
|
| &B012 |
saveix |
&02 |
|
| &B014 |
saveiy |
&02 |
|
| &B016 |
savepc |
&02 |
|
| &B018 |
savesp |
&02 |
|
| &B01A |
saveafdash |
&02 |
|
| &B01C |
savebcdash |
&02 |
|
| &B01E |
savededash |
&02 |
|
| &B020 |
savehldash |
&02 |
|
| &B022 |
savemmu0 |
&01 |
...and the memory state. |
| &B023 |
savemmu1 |
&01 |
|
| &B024 |
savemmu2 |
&01 |
|
| &B025 |
savemmu3 |
&01 |
|
| &B026 |
savecritpc |
&02 |
|
| &B028 |
savecritsp |
&02 |
|
| &B02A |
savingcontext |
&01 |
|
| &B02B |
nmimagic |
&04 |
|
| &B02F |
nmichksums |
&08 |
Checksum bytes of first 8 ROMs. |
| &B037 |
criticalpc |
&02 |
Save PC and SP for recovery from NMI during IRQ. |
| &B039 |
criticalsp |
&02 |
|
| &B03B |
|
&50 |
A small stack which is only used in initialisation. It can't sensibly overlap with anything in case there is an NMI requiring immediate shutdown after saving context. A subsequent power on will have to restore the context. |
| &B08B |
initstack |
|
|
| &B08B |
diagnostics? |
&01 |
Flag used in start-up, non-zero to do diagnostics. |
| &B08C |
saveprinstat |
&01 |
|
| &B08D |
kbdstate1 |
&0A |
1 bit per key: 1=down, 0=up to correspond to the matrix. |
| &B097 |
kbdstate2 |
&0A |
|
| &B0A1 |
padkeybuf |
&40 |
|
| &B0E1 |
padnextin |
&01 |
Offset into padkeybuf. |
| &B0E2 |
padnextout |
&01 |
|
| &B0E3 |
padbufempty |
&01 |
Non-zero if empty. |
| &B0E4 |
lastkbdstate |
&02 |
|
| &B0E6 |
thiskbdstate |
&02 |
|
| &B0E8 |
caps.state |
&01 |
0=off, &FF=on |
| &B0E9 |
savecaps |
&01 |
|
| &B0EA |
justswitchedon? |
&01 |
|
| &B0EB |
padserbuf |
&20 |
Variables above here are preserved after time-out. |
| &B10B |
padsernextin |
&01 |
|
| &B10C |
padsernextout |
&01 |
|
| &B10D |
padserbufempty |
&01 |
|
| &B10E |
padserin_xoff |
&01 |
Non-zero when XOFF has stopped inward transmission. |
| &B10F |
padserout_xoff |
&01 |
Non-zero when XOFF has stopped outward transmission. |
| &B110 |
disablexonxoff |
&01 |
Non-zero to disable software handshake. |
| &B111 |
ackirq |
&01 |
Set non-zero when ACK interrupt occurs. |
| &B112 |
rptdelay |
&01 |
Centiseconds. |
| &B113 |
rptrate |
&01 |
Centiseconds. |
| &B114 |
rpttimer |
&01 |
Count down timer for key repeat. |
| &B115 |
keytorepeat |
&01 |
Key number. |
| &B116 |
rptkeystates |
&01 |
Shift states. |
| &B117 |
rtcbuf |
&0D |
|
| &B124 |
d.alarmday |
&06 |
Alarm day, hour and minute - ready for RTC chip. |
| &B12A |
alarmhappened |
&01 |
Non zero when alarm has gone off, message pending. |
| &B12B |
alarmhappenedgotmsg |
&01 |
Non zero when alarm has gone off, got message & pending. |
| &B12C |
soundcounter |
&01 |
Non-zero if playing a tune. |
| &B12D |
soundptr |
&02 |
Pointer to array of frequency,duration. |
| &B12F |
soundrepcount |
&01 |
|
| &B130 |
soundrepptr |
&02 |
|
| &B132 |
poweroffminutes |
&01 |
Configured time to power off. |
| &B133 |
minutesleft |
&01 |
|
| &B134 |
minutecounter |
&02 |
|
| &B136 |
eventhappened |
&01 |
|
| &B137 |
preservecontext |
&01 |
0=return to main screen at power on. |
| &B138 |
dontpreservecontext |
&01 |
1=don't preserve (diagnostics/battery). |
| &B139 |
mainprog |
&01 |
6=inbasic, 128=inexternal (foreground program id). |
| &B13A |
currentprinter |
&01 |
0 for parallel, 1 for serial. |
| &B13B |
currentmenu |
&02 |
Pointer to current menu. |
| &B13D |
wasmenusel |
&01 |
After KMWAITCHAR this is 1 if menu used, 0 if not. |
| &B13E |
lastsecond |
&01 |
Checked to see whether to update the time. |
| &B13F |
clockon? |
&01 |
Used in Protext, non-zero when clock is enabled. |
| &B140 |
sdumpname |
&04 |
File names s.a, s.b, s.c and so on - for screen dumps. Force d.workspace to an 8 byte boundary. |
| &B148 |
d.workspace |
&08 |
For massaged copy of symbol data (for example, inverse/underline). |
| &B150 |
d.datebuf |
&12 |
|
| &B162 |
d.asciitime |
&0C |
hh:mm:ss |
| &B16E |
currentcfg |
&4C |
|
| &B1BA |
g.outstream |
&01 |
Bit 0 for screen, 1 for printer, 2 for file. |
| &B1BB |
g.h.outfile |
&02 |
File handle for charout if bit 2 set. |
| &B1BD |
g.pos |
&01 |
Current column number (charout). |
| &B1CE |
def.fname |
&0F |
Name of current file being edited. First byte not zero if document open (yellow/red goes to edit mode, transfer from addrbook works). |
| &B1DD |
def.first |
&01 |
|
| &B1DE |
d.findinfobuf |
&24 |
|
| &B202 |
d.row |
&01 |
0-based within window. |
| &B203 |
d.col |
&01 |
|
| &B204 |
d.wintop |
&01 |
|
| &B205 |
d.winleft |
&01 |
|
| &B206 |
d.winheight |
&01 |
Height -1. |
| &B207 |
d.winwidth |
&01 |
Width -1. |
| &B208 |
d.winset? |
&01 |
Non-zero if window. |
| &B209 |
d.state |
&01 |
Bit 7 if inverse on. |
| &B20A |
d.rowcount |
&01 |
|
| &B20B |
d.colcount |
&01 |
How many more cols to print on this line. |
| &B20C |
d.stream |
&01 |
Current stream number. |
| &B20D |
d.fastpos |
&02 |
Needed for quick screen update. |
| &B20F |
d.streamwsp |
&40 |
8 streams of 8 bytes each. |
| &B24F |
d.dateptr |
&02 |
Non-null for expanding time/date. |
| &B251 |
d.kmcharret |
&02 |
Returned character. |
| &B253 |
d.kstate |
&02 |
Key locks state. |
| &B255 |
d.caslocks |
&01 |
Shift states set by sticky key press. |
| &B256 |
d.sticky |
&01 |
Non-zero in sticky key mode. |
| &B257 |
d.yellow |
&01 |
Low byte of yellow/other key token stored. |
| &B258 |
d.calcmode |
&01 |
Non-zero if keyboard in calculator mode. |
| &B259 |
d.kmexplen |
&01 |
Expansion string length. |
| &B25A |
d.kmexpptr |
&02 |
Expansion string pointer. |
| &B25C |
d.expbuffer |
&02 |
Address of expansion key buffer. |
| &B25E |
d.expbufptr |
&02 |
Pointer to free byte. |
| &B260 |
d.expbufend |
&02 |
Last byte in buffer. |
| &B2A1 |
macro_buf |
&100 |
|
| &B3A7 |
|
|
File selector variables... |
| &B3A7 |
fs_clicat |
&01 |
Non-zero if CAT command, not fsel. |
| &B3A8 |
fs_showsizes |
&01 |
Non-zero if showing file sizes (pad default=off). |
| &B3A9 |
fs_showsys |
&01 |
Non-zero if showing system files. |
| &B3AA |
fs_curfile |
&01 |
Current file number offset from top left. |
| &B3AB |
fs_topleftfile |
&01 |
File number displayed top left. |
| &B3AC |
fs_numcols |
&01 |
|
| &B3AD |
fs_colwidth |
&01 |
|
| &B3AE |
fs_numshown |
&01 |
|
| &B3AF |
fs_maxfiles |
&01 |
Max files that can be shown. |
| &B3B0 |
fs_handle |
&02 |
|
| &B3B2 |
fs_numfilerows |
&01 |
Rows of files in CAT command. |
| &B3B3 |
fs_startlist |
&02 |
Start of file list. Zero if doing unsorted list. |
| &B3B5 |
fs_startdir |
&02 |
Start of directory entries. |
| &B3B7 |
fs_endlist |
&02 |
|
| &B3B9 |
fs_numfiles |
&01 |
Number of files in directory. |
| &B3BA |
fs_lastshown |
&01 |
Last file number currently shown. |
| &B3BB |
tickcount |
&04 |
32 bit counter needed for basic. |
| &B3BF |
ticksleftuntilevent |
&02 |
|
| &B3C1 |
tickreloadvalue |
&02 |
|
| &B3C3 |
tickeventpending |
&01 |
|
| &B3C4 |
countdowntimer |
&02 |
|
| &B3C6 |
savestream |
&01 |
|
| &B3C7 |
password |
&05 |
Encrypted. |
| &B3CC |
pwbuf |
&05 |
Clear. |
| &B3D1 |
realpwbuf |
&05 |
The real password saved for encrypting. |
| &B3D6 |
haspassword |
&01 |
Non-zero if has password. |
| &B3D7 |
passwdlen |
&01 |
|
| &B3D8 |
passwordlocked |
&01 |
Non-zero if locked (disallow soft reset). |
| &B3D9 |
editingsecret |
&01 |
Non-zero when editing secret file (can't delete it). |
| &B3DA |
inmenu? |
&01 |
Non-zero when inside menu - macros disabled. |
| &B3DB |
macro_count |
&01 |
|
| &B3DC |
recording? |
&01 |
|
| &B3DD |
macro_token |
&02 |
|
| &B3DF |
printfailed |
&01 |
Flag set by MCREADYPRINTER. |
| &B3E0 |
wasmemoryerr |
&01 |
|
| &B3E1 |
inprotext |
&01 |
Used in file selector, 0=was [Function][L], non-zero=was [Function][2]. |