		Casio PB-1000C system variables

The variable names and part of the description taken from the "The Casio
PB-1000 technical handbook".

address #bytes	name	description
=======	======	====	===========

Screen Data
&H6000	256	INTOP	Intermediate code buffer
&H6100	257	EDTOP	Input buffer
&H6201	1536	LEDTP	Display dot buffer
&H6801	192	LPFTP	4th line of the display dot buffer
&H68C1	6	CSRDT	Cursor flash data buffer
&H68C7	1	LCDST	LCD state
			Bit 0: At key input / PRINT
			Bit 1: Cursor display enable
			Bit 2: Virtual screen / Actual screen
			Bit 3: Cursor movement range setting
			Bit 4: Cursor on/off
			Bit 5: Reverse field display
&H68C8	1	EDCSR	Cursor position
&H68C9	1	SCTOP	Actual screen top
&H68CA	1	TOEDB	Logical line top
&H68CB	1	BOEDB	Logical line bottom
&H68CC	1	MOEDB	Logical line top (at INPUT)
&H68CD	1	TOARE	Cursor movement range top
&H68CE	1	BOARE	Cursor movement range bottom
&H68CF	1	EDCNT	location after the last character in the logical line,
			number of shifted or cleared character positions
&H68D0	1	DSPMD	&H00 = Normal display
			&H01 = PF display
			&H03 = MENU display
&H68D1	1	SCROL	&H80 = 4-line scroll, &H60 = 3-line scroll

Keyboard
&H68D2	1	KYSTA	Bit 0: 0
			Bit 1: keyboard beep enabled
			Bit 2: repeat on/off
			Bit 3: repeat enable
			Bit 4: contrast preset mode
			Bit 5: APO disable
			Bit 6: OFF
			Bit 7: AC
&H68D3	1	CHATA	Time count while chattering in progress
&H68D4	1	KEYCM	KO
&H68D5	2	KEYIN	KI
&H68D7	1	KEYMD	Bit 3: CAPS
			Bit 0: ENG/JAP
&H68D8	1	KYREP	Key repeat count time
&H68D9	1	KYCNT	current number of characters in the keyboard buffer
&H68DA	1		last read position in the keyboard buffer (&H00..&H0F)
&H68DB	1		last write position in the keyboard buffer (&H00..&H0F)
&H68DC	1		size of the keyboard buffer (fixed value &H10)
&H68DD	2		address of the keyboard buffer (fixed value &H68DF)
&H68DF	16		circular keyboard buffer
&H68EF	2	KANA1

&H68F1	1	APCN	APO counter (-1 for TMINIT)

Calculation
&H68F2	1	BNKNO	Not used
&H68F3	1	ANGFL	Angle mode (0=DEG, 1=RAD, 2=GRAD)
&H68F4	24	WORK1	Work buffer
&H690C	1	OUTDV	Output Device:
				&H00 = display
				&H01 = EDTOP buffer at the EDCSR position
				&H02 = printer
				&H04 = file
&H690D	1	PTABC	Number of printer output characters
&H690E	2	NOWFC	Start address of current object FCB

BASIC variable work area
&H6910	1	VAR1	number of dimensions for an indexed variable
&H6911	1	VAR2	variable type
			Bit 3:	set if numerical variable
				cleared if string variable
			Bit 7:	set if indexed variable
&H6912	1	VAR3	variable name length
&H6913	2	VAR4	pointer to the variable name

&H6915	2	CONTA	Execution restart pointer for CONT
&H6917	2	DATPA	DATA statement pointer
&H6919	1	NBX1	DRAW-statement work area
&H691A	1	NBY1	DRAW-statement work area
&H691B	1	NBX2	DRAW-statement work area
&H691C	1	NBY2	DRAW-statement work area
&H691D	2	ERRFL	Dir address for ON ERROR enable file
&H691F	2	EJPDE	ON ERROR jump destignation pointer
&H6921	2	ERRLN	Line number containing error generation
&H6923	2	ERRDE	Address of statement containing error generation
&H6925	1	ERRN	Error number
&H6926	1	EJPFG	&H00=Normal processing, &H01=ON ERROR handling routine
&H6927	1	TRAFG	&H00=TROFF, &H01=TRON
&H6928	2	INPER	Return address for INPUT error
&H692A	1	MACCN
&H692B	1

CASL/COMET
&H692C	1		&H00=PRTOFF, &H01=PRT ON
&H692D	1		&H01 when the BRK key was pressed during execution,
			otherwise &H00
&H692E	1		&H01 when quick assembly and execution, otherwise &H00

Pointers to main memory areas
&H692F	2	IOBF	I/O buffer, fixed value defined with the command CLEAR
&H6931	2	SSTOP	begin of the character operation stack, grows upwards
&H6933	2	SBOT	end of the character operation stack, grows upwards
&H6935	2	FORSK	top of the FOR stack, grows downwards
&H6937	2	GOSSK	top of the GOSUB stack, grows downwards
&H6939	2	TONDT	top of contents of numeric variables, grows downwards
&H693B	2	DTTB	top of variable table, grows downwards
&H693D	2	TOSDT	fixed value defined with CLEAR
&H693F	2	PDSTD	end of contents if string variables, grows upwards
&H6941	2	HIMEM	begin of BASIC files, fixed value defined with CLEAR
&H6943	2	BASEN	end of BASIC files, begin of data files, grows upwards
&H6945	2	MEMEN	end of data files, grows upwards
&H6947	2	DATDI	top of data directory, grows downwards
&H6949	2	BASDI	top of BASIC directory, grows downwards
&H694B	2	DIREN	end of the directory and last byte of RAM
			(&H7FFF for 8kB, &HFFFF for 40kB)

&H694D	2	ACJMP	Address of jump destignation for BREAK
&H694F	1	CHARA
&H6950	1	ANSFG	Post calculating flag (1=After calculation, 0=Other)
&H6951	1	CSRCN	Cursor flash counter (-1 when ONINIT)
&H6952	249	USPBT	User stack area
&H6A4B	0	USPTP
&H6A4B	255	SSPBT	System stack area
&H6B4A	0	SSPTP
&H6B4A	96	CGRAM	&HF0-&HFF display dot pattern
&H6BAA	2	ELVAD	pointer to the contrast data
&H6BAC	1	BEEPF	Key beep flag (ON=0, OFF=1)
&H6BAD	3	DATE	DATE$ data
&H6BB0	2	TIME	TIME$ data
&H6BB2	72	STAT	STAT data
&H6BFA	1	OPTCD	Option code
&H6BFB	1	IOSTS	Bit 0: send open
			Bit 1: receive open
&H6BFC	1	RS1	Bit 0: MT/RS232C
			Bit 1: Odd/Even parity
			Bit 2: OFF/ON
			Bit 3: 7/8 data length
			Bit 4: 1 / 2 stop bit
			Bit 5-7:
				000=9600 baud
				001=4800 baud
				010=2400 baud
				011=1200 baud
				100=600 baud
				101=300 baud
				110=150 baud
				111=75 baud
&H6BFD	1	RS2	Bit 0: Output while XOFF in progress
			Bit 1: Input while SO in progress
&H6BFE	1	RS3	Bit 0: SI/SO control
			Bit 1: XON/XOFF control
			Bit 2: CTS control
			Bit 3: DSR control
			Bit 4: CD control
			Bit 5: Output SO in progress
			Bit 6: Input XOFF in progress
&H6BFF	1	RS4	Bit 0: Buffer overflow
			Bit 4: Not ready
			Bit 6: Parity/Overrun
			Bit 7: Framing
&H6C00	2		default values for RS1, RS3
&H6C02	2	PRNFG	printer flags tested before and after output of
			character
			Bit 0: BUSY
			Bit 1: ERROR
			Bit 2: ACK
&H6C04	1	DSPFG	&H00=Full screen display
			Bit 0-2: Last display line (0-3)
			Bit 5-7: First display line (0-3)
&H6C05	1	INTCK	&H01=data receive
&H6C06	258	RXCNT	RS232C, MT receive buffer
			1 Byte = number of received bytes
			1 Byte = input pointer
			256 Bytes = buffer
&H6D08	8	ANSAD	ANS data
&H6D10	1		offset of the exponent in the ENG mode, 255 if none yet
&H6D11	9	RND	Random data
&H6D1A	258	CALC	Calc buffer
&H6E1C	1	MTFL	MT work - file type
&H6E1D	35	IOBFO	SAVE/LOAD FCB
&H6E40	258	IOBUF	SAVE/LOAD I/O buffer
&H6F42	5	IMAT	Clock boot flag
&H6F47	2	ONFIL0	Clock boot file address
&H6F49	2	ONFIL1	Preset file address
&H6F4B	2	ONFIL2	Preset file address
&H6F4D	2	ONFIL3	Preset file address
&H6F4F	2	ONFIL4	Preset file address
&H6F51	1	MODE	Bit 0: BASIC
			Bit 1: EDIT
			Bit 2: MEMO
			Bit 3: INPUT
			Bit 4: CALC
			Bit 5: SAVE/LOAD
			Bit 6: MENU
&H6F52	1		Bits 6,5: select sub-menu
				00: [basic ][data  ]...
				01: [name  ][kill  ]...
				10: [asmbl ][llist ]...
&H6F53	1		During BASIC execution:
				&H00: interactive mode
				&H01: RUN mode
				&H02: STOP mode, CONT possible
			In MENU mode:
				&H00: main menu
				&H04: sub-menu "dump"
				&H06: sub-menu "load"
				&H08: sub-menu "save"
				&H0A: sub-menu "disk"
				&H0C: sub-menu "CASL"
				&H0E: sub-menu "asmbl"
				&H10: sub-menu "PRT SW"
				&H12: sub-menu "TR SW"
&H6F54	2	NOWFL	pointer to the directory entry of currently used file
&H6F56	2	NOWLN	Current execution line number
&H6F58	2	EXEDE	Work
&H6F5A	16	FDDFL	directory entry read from the floppy disk
&H6F6A	2	LOADB	Work
&H6F6C	1	MTFL2	segment checksum
&H6F6D	1	MTFL3	Work
&H6F6E	1	MTFL5	Work
&H6F6F	1	MTFL6	Work
&H6F70	2	MTFL7	Work
&H6F72	2	MTFL8	Work
&H6F74	32	BSYWK	Work
&H6F94	15	MENUC	Work

&H6F94 (1 byte) - when the screen shows the file list: index of the selected
 file on the screen, 0 when top left item
&H6F95..&H6FA0 (6 words) - when the screen shows the ramdisk file list:
 pointers to the 6 directory entries of the files shown on the screen

&H6FA3	12	INPST	Work
&H6FAF	35		buffer for an I/O control block header


For each opened file, a control block of following structure is allocated in
the I/O buffer:
&H0000	291		block size in bytes
&H0002	1		handle in range 0..15
&H0003	1		access mode
			&H30 = OUTPUT, &H31 = RANDOM, &H32 = INPUT,
			&H34 = APPEND
&H0004	1		device type
			0 = ramdisk, 1 = FDD, 2 = COM port, 3 = tape
&H0005	11		file name
&H0010	2		pointer to the begin of the data buffer
&H0012	2		pointer to the end of the data buffer
&H0014	1		counter of bytes in the data buffer
&H0015	1		memory overflow flag
&H0016	1		EOF flag (0 = not EOF, &HFF = EOF)
&H0017	2		pointer to the current position in the data buffer
&H0019	1
&H001A	2		record number
&H001C	1		file type
&H001D	2		starting address of the RAM file
&H001F	2		ending address of the RAM file
&H0021	2		pointer to the current position in the RAM file
&H0023	256		data buffer

CASL/COMET
&H6FD7	2		top of the local symbol table, grows downwards
&H6FD9	2		top of the global symbol table, grows downwards
&H6FDB	2		bottom of the symbol table
&H6FDD	2		default object code execution address
&H6FDF	2		pointer to the begin of the object code
&H6FE1	2		last address in the object code
&H6FE3	2		Program Counter PC
&H6FE5	1		&H00=TROFF, &H01=TRON, &H02=LTRON
&H6FE6	1		&H01 when a breakpoint was reached, otherwise &H00
&H6FE7	1		&H00=breakpoint not set, &H01=breakpoint set
&H6FE8	2		breakpoint address

&H6FEE	1		register index
&H6FEF	2		register GR0
&H6FF1	2		register GR1
&H6FF3	2		register GR2
&H6FF5	2		register GR3
&H6FF7	2		register GR4
&H6FF9	1		register FR


Memory map of the area between the address &H7000 and the end of RAM

 =========================================
| reserved area for machine code programs |
 =========================================	<- pointer IOBF
| I/O buffer                              |
 -----------------------------------------	<- pointer SSTOP
| character operation stack               |
| (work area for strings)                 |
 -----------------------------------------	<- pointer SBOT
| ...                                     |
| system work free area                   |
| ...                                     |
 -----------------------------------------	<- pointer FORSK
| FOR stack                               |
 -----------------------------------------	<- pointer GOSSK
| GOSUB stack                             |
 -----------------------------------------	<- pointer TONDT
| contents of numeric variables           |
 -----------------------------------------	<- pointer DTTB
| variable table                          |
 =========================================	<- pointer TOSDT	
| contents of string variables            |
 -----------------------------------------	<- pointer PDSTD
| ...                                     |
| character data free area                |
| ...                                     |
 =========================================	<- pointer HIMEM
| BASIC files                             |
 -----------------------------------------	<- pointer BASEN
| data files                              |
 -----------------------------------------	<- pointer MEMEN, &H6FDF
| CASL object code               |        |
 --------------------------------         |
| ...                                     |
| file free area                          |
| ...                                     |
 --------------------------------         |	<- pointer &H6FD7
| CASL local symbol table        |        |
 --------------------------------         |	<- pointer &H6FD9
| CASL global symbol table       |        |
 -----------------------------------------	<- pointer DATDI, &H6FDB
| data directory                          |
 -----------------------------------------	<- pointer BASDI
| BASIC directory                         |
 =========================================	<- pointer DIREN
