The NC100 System Variables

Following are some of the more important RAM-based variables used by the operating system. Amstrad have expressed an intent always to try and use these locations in subsequent versions of the software, but they are not guaranteeing it. It would be sensible to perform checks by calling firmware routines which return known values to selected addresses and only if the correct values are returned for addresses you wish to use, should then assume they are available to you.

Many of the addresses shown here have little or no explanation other than the name given to them by the program developers. It is entirely up to you to experiment with them and come to your own decision as to their usefulness. Thankfully though, many addresses are fully self-evident and will provide you with a lot of scope for enhancing your own programs.

&B00045056copyofmmu0&01Copy of MMU0
&B00145057copyofmmu1&01Copy of MMU1
&B00245058copyofmmu2&01Copy of MMU2
&B00345059copyofmmu3&01Copy of MMU3
&B03B45115&50A small strack which is only used in initialisation. Therefore, you should be able to use this as a temporary storage area when code space is tight.
&B08D45197kbdstate1&0A1 bit per key: 1=down, 0=up to correspond to the matrix
&B09745207kbdstate2&0A2nd byte of state
&B0A145217padkeybuf&40Keyboard buffer
&B0E145281padnextin&01Offset into padkeybuf
&B0E245282padnextout&01Next character due out
&B0E345283padbufempty&01Non-zero if empty
&B0E445284lastkbdstate&02Saved state
&B0E645286thiskbdstate&02This state
&B0E845288caps.state&010=ff, &FF=on
&B11245330rptdelay&01Keyboard repeat centiseconds
&B11345331rptrate&01Keyboard delay centiseconds
&B11445332rpttimer&01Count down timer for key repeat
&B11545333keytorepeat&01Key number
&B11645334rptkeystates&01Shift states
&B12C45356soundcounter&01Non-zero if playing a tune
&B12D45357soundptr&02Pointer to array of frequency, duration
&B13245362poweroffminutes&01Configured time to power off
&B13345363minutesleft&01Minutes left
&B13445364minutecounter&02Minute counter
&B13745367preservecontext&010=return to main screen at power on
&B13845368dontpreservecontext&011=don't preserve (diagnostics/battery)
&B13945369mainprog&016=inbasic, 128=inexternal (foreground program id)
&B13A45370currentprinter&010 for parallel, 1 for serial
&b13D45373wasmenusel&01After KMWAITCHAR this is 1 if menu used, 0 if not
&B14045376sdumpname&04File names s.a, s.b, s.c and so on - for screen dumps
&B15045392d.datebuf&12Date buffer
&B16E45422currentcfg&4CCurrent configuration parameters
&B1BD45501g.pos&01Current column number (charout)
&B25845656d.calcmode&01Non-zero if keyboard in calculator mode
&B25945657d.kmexplen&01Expansion string length
&B25A45658d.kmexpptr&02Expansion string pointer.
&B25C45660d.expbuffer&02Address of expansion key buffer
&B25E45662d.expbufptr&02Pointer to free byte
&B26045664d.expbufend&02Last byte in buffer
&B2A145729macro_buf&100Macro buffer
&B3A745991-File selector variables...
&B3A745991fs_clicat&01Non-zero if Cat command, not Select
&B3A845992fs_showsizes&01Non-zero if showing file sizes (pad default=off)
&B3A945993fs_showsys&01Non-zero if showing system files
&B3AA45994fs_curfile&01Current file number offset from top left
&B3AB45995fs_topleftfile&01File number displayed top left
&B3AC45996fs_numcols&01Number of columns
&B3AD45997fs_colwidth&01Width of columns
&B3AE45998fs_numshown&01Number of columns shown
&B3AF45999fs_maxfiles&01Max files that can be shown
&B3B246002fs_numfilerows&01Rows of files in CAT command
&B3B346003fs_startlist&02Start of file list. Zero if doing unsorted list
&B3B546005fs_startdir&02Start of directory entries
&B3B946009fs_numfiles&01Number of files in directory
&B3BA46010fs_lastshown&01Last file number currently shown
BBC Basic Main System Variables
&A00040960&100String accumulator
&A10041216&100String input buffer
&A20041472&6CStatic variables @% to Z%
&A2E241698&02Free space pointer
&A2E641702&02Current line number
&A2E841704&02TRACE number
&A2EA41706&02AUTO number
&A2EC41708&02ON ERROR number