		Casio CASL card OM-54A system variables

The names of equivalent PB-1000 variables and part of the description taken
from the "Casio PB-1000 technical handbook".
Some unused ones kept for compatibility with other programming languages.
The list is incomplete yet.

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

Screen Data
&H0000	256	INTOP	Intermediate code buffer
&H0100	257	EDTOP	Input buffer
&H0201	1536	LEDTP	Display dot buffer
&H0801	192	LPFTP	4th line of the display dot buffer
&H0801	6	CSRDT	Cursor data buffer, shares space with LPFTP, perhaps
			the address should have been &H08C1 ?
&H08C7	3		contrast data
&H08CA	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 in force
			Bit 4: Cursor on/off
			Bit 5: Reverse field display
&H08CB	1	EDCSR	Cursor position
&H08CC	1	SCTOP	Actual screen top
&H08CD	1	TOEDB	Logical line top
&H08CE	1	BOEDB	Logical line bottom
&H08CF	1	MOEDB	Logical line top (at INPUT)
&H08D0	1	TOARE	Cursor movement range top
&H08D1	1	BOARE	Cursor movement range bottom
&H08D2	1	EDCNT	location after the last character in the logical line,
			number of shifted or cleared character positions
&H08D3	1	DSPMD	&H00 = Normal display
			&H01 = PF display
			&H03 = MENU display
&H08D4	1	SCROL	&H80 = 4-line scroll, &H60 = 3-line scroll
&H08D5	2	ELVAD	pointer to the contrast data
&H08D7	1	CSRCN	cursor flash counter
&H08D8	1		cursor flash rate, default value &H5F
&H08D9	1	APOCN	APO counter, current value of the auto power-off timer
&H08DA	1		default value of the auto power-off timer, to be used
			when waiting for a key press
&H08DB	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
&H08DC	1	RS2	Bit 0: Output while XOFF in progress
			Bit 1: Input while SO in progress
&H08DD	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
&H08DE	1	RS4	Bit 0: Buffer overflow
			Bit 1: Parity/Overrun
			Bit 2: Framing
			Bit 3: Not ready
&H08DF	1	INTCK	&H01=data receive
&H08E0	258	RXCNT	RS232C, MT receive buffer
			1 Byte = number of received bytes
			1 Byte = input pointer
			256 Bytes = buffer

Keyboard
&H09E2	2	KANA1
&H09E4	1	KEYMD	bit 5: ENG/JAP
			bit 6: CAPS mode
			bit 7: S mode
&H09E5	1	KYSTA	bit 1: keyboard beep enabled
			bit 2: repeat on/off
			bit 4: contrast preset mode
&H09E6	1	CHATA	keyboard debounce counter
&H09E7	1	KEYCM	KO
&H09E8	2	KEYIN	KI
&H09EA	1	KYREP	Key repeat count time
&H09EB	1
&H09EC	1	KYCNT	current number of characters in the keyboard buffer
&H09ED	1		last read position in the keyboard buffer (&H00..&H0F)
&H09EE	1		last write position in the keyboard buffer (&H00..&H0F)
&H09EF	1		size of the keyboard buffer (fixed value &H10)
&H09F0	2		address of the keyboard buffer (fixed value &H09F2)
&H09F2	16		circular keyboard buffer

&H0A02	1	ANSFG	Post calculating flag (1=After calculation, 0=Other)
&H0A03	1	ANGFL	Angle mode (0=DEG, 1=RAD, 2=GRAD)
&H0A04	1		"integer cheating" flag, (1=cheating disabled)
&H0A05	1		tabulation setting (1 to 8)
&H0A06	96	CGRAM	&HF0-&HFF display dot pattern
&H0A66	2		card ROM ID

CASL/COMET
&H0A68	2		top of the local symbol table, grows downwards
&H0A6A	2		top of the global symbol table, grows downwards
&H0A6C	2		bottom of the symbol table
&H0A6E	2		default object code execution address
&H0A70	2		pointer to the begin of the object code
&H0A72	2		last address in the object code
&H0A74	2		Program Counter PC
&H0A76	1		&H00=TROFF, &H01=TRON
&H0A77	1		&H01 when a breakpoint was reached, otherwise &H00
&H0A78	1		&H00=breakpoint not set, &H01=breakpoint set
&H0A7A	2		breakpoint address

&H0A80	1		register index
&H0A81	2		register GR0
&H0A83	2		register GR1
&H0A85	2		register GR2
&H0A87	2		register GR3
&H0A89	2		register GR4
&H0A8B	1		register FR

&H0A8D	1		&H00=LSTOFF, &H01=LSTON
&H0A8E	1		&H01 when the BRK key was pressed during execution,
			otherwise &H00
&H0A8F	1		&H01 when quick assembly and execution, otherwise &H00
&H0A90	1		&H00=PRTOFF, &H01=PRTON
&H0A91	2	NOWLN	current execution line number

Pointers to main memory areas
&H0A98	2	IOBF	I/O buffer
&H0A9A	2	SSTOP	begin of the character operation stack, grows upwards
&H0A9C	2	SBOT	end of the character operation stack, grows upwards
&H0A9E	2	FORSK	unused, the same value as TONDT
&H0AA0	2	GOSSK	unused, the same value as TONDT
&H0AA2	2	TONDT	top of contents of numeric variables, grows downwards
&H0AA4	2	DTTB	top of variable table, grows downwards
&H0AA6	2	TOSDT	unused, the same value as HIMEM
&H0AA8	2	PDSTD	unused, the same value as HIMEM
&H0AAA	2	HIMEM	begin of files
&H0AAC	2	BASEN	unused, the same value as HIMEM
&H0AAE	2	MEMEN	end of files, grows upwards
&H0AB0	2	DATDI	top of directory, grows downwards
&H0AB2	2	BASDI	unused, the same value as DIREN
&H0AB4	2	DIREN	end of the directory
&H0AB6	2		begin of the user memory area
&H0AB8	2		default values for RS1, RS3
&H0ABA	2	PRNFG	printer flags tested before and after output of
			character
			Bit 0: BUSY
			Bit 1: ERROR
			Bit 2: ACK
&H0ABC	1	OPTCD	option code
&H0ABD	1	OUTDV	output device, 0=LCD, 2=printer, 4=file
&H0ABE	1	IOSTS	Bit 0: send open
			Bit 1: receive open
&H0AC0	8	ANSAD	ANS data
&H0AC8	1
&H0AC9	2	ONFIL1	preset file address
&H0ACB	2	ONFIL2	preset file address
&H0ACD	2	ONFIL3	preset file address
&H0ACF	2	ONFIL4	preset file address

&H0ADD	1		bit 0: switch on mode Calc/Menu
			bit 6: stop on error
&H0ADE	258	CALC	Calc buffer
&H0BE1	257	USPBT	user stack area
&H0CE2	0	USPTP
&H0CE2	2	ACJMP	jump address for BREAK
&H0CE6	32	WORK1	work buffer
&H0D0B	1	MODE	Bit 0: CASL
			Bit 1: EDIT
			Bit 2: MEMO
			Bit 3: INPUT
			Bit 4: CALC
			Bit 5: SAVE/LOAD
			Bit 6: MENU
&H0D0C	1		Bits 6,5: select sub-menu
				00: [CASL  ][llist ]...
				01: [name  ][kill  ]...
				10: [set   ][memory]...
&H0D0D	1		In MENU mode:
				&H00: main menu
				&H06: sub-menu "load/merge"
				&H08: sub-menu "save"
				&H0A: sub-menu "disk"
&H0D0E	2	NOWFL	directory entry of currently used file
&H0D10	1	NBX1	line drawing work area
&H0D11	1	NBY1	line drawing work area
&H0D12	1	NBX2	line drawing work area
&H0D13	1	NBY2	line drawing work area
&H0D15	15	MENUC	Work

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

&H0D2C	2	NOWFC	start address of current object FCB
&H0D2F	35	IOBFO	save/load FCB
&H0D45	258	IOBUF	SAVE/LOAD I/O buffer
&H0E54	35		buffer for an I/O control block header
&H0E7C	16	FDDFL
&H0E8C	2	LOADB	Work
&H0E8E	1	MTFL2	segment checksum

&H0E99	257	SSPBT	system stack area
&H0F9A	0	SSPTP

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


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

						<- pointer &H0AB6
 =========================================	<- pointer IOBF
| I/O buffer                              |
 -----------------------------------------	<- pointer SSTOP
| Character operator stack                |
 -----------------------------------------	<- pointer SBOT
| ...                                     |
| work free area                          |
| ...                                     |
 -----------------------------------------	<- pointer TONDT
| Numeric variable data area              |
 -----------------------------------------	<- pointer DTTB
| Variable table                          |
 =========================================	<- pointer HIMEM
| file area                               |
 -----------------------------------------	<- pointer MEMEN, &H0A70
| CASL object code               |        |
 --------------------------------         |
| ...                                     |
| file free area                          |
| ...                                     |
 --------------------------------         |	<- pointer &H0A68
| CASL local symbol table        |        |
 --------------------------------         |	<- pointer &H0A6A
| CASL global symbol table       |        |
 -----------------------------------------	<- pointer DATDI
| directory area                          |
 =========================================	<- pointer DIREN (FFFF)
