Entry points to various Level II BASIC ROM routines which may be accessed by user programs.


Keyboard Routines:

KBD1
002BH
INKEY$ CALL
$KBCHAR SCAN KEYBOARD FOR A CHARACTER
KBD2
0358H
SAVE DE REGS, THEN CALL 2B
$KBLINE
0040H
GET A LINE FROM THE KEYBOARD
KBWT1
0049H
KBD INPUT WITH WAIT
$KBWAIT WAIT FOR A KEYBOARD CHARACTER
KBWT2
0384H
KBD INPUT WITH WAIT, DE SAVED
LINP1
05D9H
LINE INPUT ROUTINE
Enter With:
  • HL => STORAGE ADDRESS
  • B =>MAX LENGTH TO INPUT
LINP2
0361H
LINE INPUT ROUTINE 2
INPUT
1BB3H
SAME AS LINP2, BUT WITH “?”
LBUFF
40A7H
STORAGE BUFFER ADDRESS FOR LINP2


Display Routines:

DSP1
0033H
Display byte at cursor pos
$VDCHAR DISPLAY A CHARACTER ON THE SCREEN
CLS
01C9H
Clear screen
BLINK
022CH    
Blink “*” in right upper corner
DSP2
033AH
SAVES DE AND CALLS DSP1
DSTR
28A7H
DISPL STRING POINTED TO IN HL
SETRES
0150H
ENTRY TO SET/RESET ROUTINES
CURSOR
4020H
CURSOR POSITION


Printer Routines:

$PRCHAR
003BH
PRINT A CHARACTER ON THE PRINTER


Miscellaneous routines & addresses

BASIC
1A19H
RETURN POINT FOR BASIC
DOS
402DH
RETURN POINT FOR DOS
DOSERR
4030H
RETURN TO DOS WITH ERROR
CHLDE
1C90H
COMPARE HL WITH DE
FETCH
1D78H
FETCH NEXT NON-BLANK CHARACTER FOLLOWING THAT IN HL
DECBIN
1E5AH
DECIMAL # => BINARY
WLDR
0284H
WRITES LEADER ON CASSETTE TAPE
WBYTE
0264H
WRITES ONE BYTE TO TAPE
COFF
01F8H
TURNS OFF CASSETTE MOTOR
RLDR
0293H
READS SYNC BYTE FROM CASSETTE
RBYTE
0235H
READS ONE BYTE FROM TAPE

Floating-point arithmetic routines

TYPE FLAG IS 40AFH; VALUES AS FOLLOWS:

2 – INTEGER
3 – STRING
4 – SINGLE PRECISION FLOATING POINT
8 – DOUBLE PRECISION FLOATING POINT


FLOATING POINT ACCUMULATORS (FPACC) AS FOLLOWS:

INTEGER
4121H – 4122H
STRING
4121H – 4122H HOLDS DESCRIPTOR ADDRESS
SINGLE PRECISION
4121H – 4124H (4124 IS EXPONENT)
DOUBLE PRECISION
411DH – 4124H (4124 IS EXPONENT)

OPERAND LOCATIONS AS FOLLOWS:

INTEGER
REGISTER PAIRS DE & HL
SINGLE PRECISION
REGISTER PAIRS DE & HL
DOUBLE PRECISION
4127H – 412EH
TSTYP
25D9H
TEST TYPE FLAG AT 40AF
DSTOR
09B4H
STORE SNG-PRC VAL IN DE:BC IN FPACC
SLOAD
09C2H
LOAD SNG-PRC INTO DE:BC FROM ADDRESS IN HL
SCOPY
09B1H
COPY SNG-PRC FROM HL ADDR TO FPACC
SGET
09BFH
LOAD FPACC INTO DE:BC
SSTAK
09A4H
PUSH FPACC INTO STACK (DE BC)
ISTOR
0A9AH
STORE INT IN FPACC & SET TYPE
ASTOR
0E6CH
STORE NUMERIC STRING IN FPACC
NEDIT
0FBDH
NON-FORMATTED NUMERIC EDIT
FEDIT
0FBEH
FORMATTED NUMERIC EDIT
CSVEC
2865H
CREATE STRING VECTOR
FPACC
4121H
FLOATING POINT ACCUMULATOR
DFPACC
411DH
DOUBLE-PRECISION FPACC
DOPER
4127H
DOUBLE-PRECISION OPERAND REGS


Arithmetic function routines

IADD
0BD2H
INTEGER ADD DE+HL =>FPACC
ISUB
0BC7H
INTEGER SUBTRACT DE-HL=>FPACC
IMUL
0BF2H
INTEGER MULTIPLY DE*HL=>FPACC
IDIV
2490H
INTEGER DIVIDE DE/HL =>FPACC
SADD
0716H
SNGPRC ADD OPER+FPACC=>FPACC
SSUB
0713H
SNG SUBTRACT OPER-FPACC=>FPACC
SMUL
0847H
SNG MULTIPLY OPER*FPACC
SDIV
08A2H
SNG DIVIDE OPER/FPACC
DADD
0C77H
DBL PREC OPER+FPACC
DSUB
0C70H
DBL PREC SUBTRACT OPER-FPACC
DMUL
0DA1H
DBL PREC OPER*FPACC
DDIV
0DE5H
DBL PREC OPER/FPACC
SGN
098AH
FPACC = SGN(FPACC)
INT
0B37H
FPACC = INT(FPACC)
ABS
0977H
FPACC = ABS(FPACC)
SQRT
13E7H
FPACC = SQRT(FPACC)
RNDM
14C9H
FPACC = RND(FPACC)
LOG
0809H
FPACC = LOG(FPACC)
EXP
1439H
FPACC = EXP(FPACC)
COSN
1541H
FPACC = COS(FPACC)
SINE
1547H
FPACC = SIN(FPACC)
TAN
15A8H
FPACC = TAN(FPACC)
ATAN
15BDH
FPACC = ATAN(FPACC)
CINT
0A7FH
FPACC = CINT(FPACC)
CSNG
0AB1H
FPACC = CSNG(FPACC)
CDBL
0ADBH
FPACC = CDBL(FPACC)
FIX
0B26H
FPACC = FIX(FPACC)

DEC ADDR
HEX ADDR
FUNCTION
14305
37E1H
0, FOR BETTER DISK SAVES
16405
4015H
1 =KEYBOARD ON
2 =KEYBOARD OFF
16413
401DH
1 =DISPLAY OFF
7 =DISPLAY ON
16414
401EH
141 =DISPLAY TO PRINTER
88 =RESTORE DISPLAY
16415
401FH
5, 4 =???
16449
4041H
CLOCK REGISTER, SECONDS
16450
4042H
CLOCK REGISTER, MINUTES
16451
4043H
CLOCK REGISTER, HOURS
16452
4044H
CLOCK REGISTER, YEAR
16453
4045H
CLOCK REGISTER, DAY
16454
4046H
CLOCK REGISTER, MONTH
16553
404FH
255 = DATA READ AFTER CASS INP
14312
37E8H
> 127 =LINEPRINTER NOT READY
15339
3BFFH
CHECK IF KEY HELD DOWN
16457
4049H
TOP-OF-MEMORY (DOS MAIN SYSTEM) DISK BASIC HOLDS VALUE-1 IN 40B1.
 
40A0H-
40A1H
POINTER TO THE STRING STORAGE AREA (IE., IF YOU “CLEAR 50” THESE ADDRESSES WILL HOLD THE VALUE IN 40B1-40B2 MINUS 50). ALWAYS STORED LSB/MSB.