Appendix B - BASIC ROM summary

BASIC1BASIC2ROUTINE
80008000BASIC entry point
80068006Paged ROM data
801F8023Language initialisation
806D8071Keyword table
835A836DKeyword action address table
843C8451Assembler mnemonic tables
84E684FD']' (Back to BASIC from assembler)
84ED8504'[' statement (Assembler entry point)
87E48821Evaluate integer <numeric>
87FD887CSubstitute token in buffer
88198897Tokenise line number
88AB8926Check for alphanumeric char (or '.')
88D38951Tokenise a line
8A138A8CGet character at PTRB
8AlE8A97Get character at PTRA
8A3D8AB6'OLD' statement
8A508AC8'END' statement
8A598AD0'STOP' statement
8A7D8ADA'NEW' statement
8A808ADDCold start
8A968AF3W arm start
8A998AF6Enter immediate mode
8BAA8B47'=' statement (return FN value)
8BC38B73'*' statement (send line to OSCLI)
8AED8B7D'DATA','DEF', 'REM' statement (skip line)
8B0C8B9BContinue execution at next statement
8B578BE4'LET' statement
8BD08C1EAssign string
8C5B8CC1Pop parameter value
8CC58D2B'PRINT#' statement
8D338D9A'PRINT' statement
8DBD8E2A'TAB(X,Y)' in printable section
8DD98E40'TAB(' in printable section
8DF28E58'SPC' in printable section
8E578EBD'CLG' statement
8E5E8EC4'CLS' statement
8E6C8ED2'CALL' statement
8ECE8F31'DELETE' statement

8F37
8FA3'RENUMBER' statement
905F90AC'AUTO' statement
90DD912F'DIM' statement
91EB9236Perform 'space required' multiplication
9212925D'HIMEM' statement
9224926F'LOMEM' statement
92399283'PAGE' statement
9326928D'CLEAR' statement
9243929F'TRACE' statement
927B92C9'TIME' statement
929292E3Get integer <factor>
92AC92EBGet real <factor>
92B69304'PROC' statement
92D59323'LOCAL' statement
93109356'ENDPROC' statement
932F937A'GCOL' statement
9346938E'COLOUR' statement
935A939A'MODE' statement
93A193E4'MOVE' statement
93A593E8'DRAW' statement
93AE93F1'PLOT' statement
93EF942F'VDU' statement
941B945BLook for FN/PROC in list
94299469Look for variable in list
94AD94EDLink in new PROC/FN
94BC94FCLink in new variable
94F79531Clear space for information block
951F9559Scan variable name
95489582Find variable, creating if needed
959595C9Find variable at PTRA
95A995DDFind variable at PTRB
97AC97DDGet tokenised line number at PTRA
97D69807Set PTRB to PTRA, then. ..
97E29813Evaluate <numeric> after '='
980B9852Check end of statement at PTRB
98109857Check end of statement at PTRA
98519880Move to start of next statement
989398C2'IF' statement
98F1991FPrint line number in IntA
99429970Look for program line
99C099EAPerform integer division
9A769A9EPerform comparison
9AF79B1DSet PTRB to PTRA, then...

9B03
9B29Get <numeric> or <string> at PTRB
9B149B3A'OR' operator
9B2F9B55'EOR' operator
9B459B72Get <logical expression>
9B549B7A'AND' operator
9B769B9CGet <relnl expression>
9B889BAE'=' operator (comparison)
9BA79BCD'<' operator
9BAE9BD4'<=' operator
9BB99BDF'<>' operator
9BCB9BE8'>' operator
9BD49BFA'>=' operator
9C1D9C42Get <expression>
9C299C4E'+' operator
9C909CB5'-' operator
9D179D3C'*' operator
9DAE9DD1Get <term>
9DC29DE5'/' operator
9DDE9E01'MOD' operator
9DE79E0A'DIV' operator
9DFD9E20Get <sub-term>
9E129E35'­' operator (exponentiation)
9E819E90Convert number to HEX string
9ED09EDFConvert number to string
A06CA07BGet number at PTRB
A169A178Add FPB mantissa to FPA mantissa
A188A197Multiply FPA mantissa by 10
A1CBA1DATest FP A
A1E5A1F4Multiply FPA by 10
A20FA21ECopy FPA into FPB
A23EA24DDivide FPA by 10
A295A2A4Add A to PEA mantissa
A2AFA2BEConvert IntA to FPA
A2DEA2EDConvert A to FPA
A2F4A303Normalise FPA
A33FA34ELoad FPB from packed number at (&4B)
A36EA37DStore FPA at &471 -&475
A372A381Store FPA at &476-&47 A
A376A385Store FPA at &46C-&470
A37EA38DStore FPA at (&4B)
A3A3A3B2Load FPA from &46C-&470
A3A6A3B5Load FPA from (&4B)
A3F2A3E4Convert FPA to IntA

A40C
A3FEConvert FPA to fixed format
A463A453Set FPB to zero
A494A486Extract fractional part of FPA
A505A4D0Subtract number at (&4B) from FP A
A4DEA4D6Exchange FPA with number at (&4B)
A4E4A4DCCopy FPB into FPA
A50BA4FDSubtract FPA from number at (&4B)
A50EA500Add number at (&4B) to FPA
A513A50BAdd FPB to FPA
A611A606Multiply FPA by number at (&4B)
A6lEA613Multiply FPA by FPB
A661A656Multiply FPA by (&4B); test for o'flow
A691A686Set FPA to zero
A6A4A699Set FPA to 1
A6B0A6A5Invert FPA (set FPA = 1/FPA)
A6B8A6ADDivide (&4B) by FPA
A6C9A6BE'TAN' function
A6F2A6E7Divide FPA by (&4B)
A6FCA6F1Divide FPA by FPB
A7B4A7B4'SQR' function
A7EFA7E9Point &4B ,&4C at &47B
A7F3A7EDPoint &4B,&4C at &471
A7F7A7F1Point &4B,&4C at &476
A7FBA7F5Point &4B,&4C at &46C
A804A7FE'LN' function
A856A869Constant: log(e) (i.e. 'LOG EXP 1')
A85BA86EConstant: ln(2)
A860A873Constant series for 'LN' evaluation
A889A897Perform series evaluation
A8C6A8D4'ACS' function
A8CCA8DA'ASN' function
A907A907'ATN' function
A956A95AConstant series for 'ATN' evaluation
A989A98D'COS' function
A994A998'SIN' function
AA5CAA48Point &4B,&4C at 'coarse -PI/2'
AA60AA4CPoint &4B ,&4C at adjustment to above
AA69AA55Point &4B,&4C at PI/2
AA6DAA59Constant: 'coarse -PI/2'
AA73AASEConstant: adjustment to 'coarse -PI/2'
AA77AA63Constant: PI/2
AA7CAA68Constant: PI/180 (for 'RAD')
AA81AA6DConstant: 180/PI (for 'DEG')

AA86
AA72Constant series for 'SIN' evaluation
AAB4AA91'EXP' function
AB07AAE4Constant: e ('EXP 1')
AB0CAAE9Constant series for 'EXP' evaluation
AB56AB33'ADVAL' function
AB64AB41'POINT' function
AB92AB6D'POS' function
AB9BAB76'VPOS' function
ABAEAB88'SGN' function
ABCDABA8'LOG' function
ABD6ABB1'RAD' function
ABE7ABC2'DEG' function
ABF0ABCB'PI' function
ABFBABD2'USR' function
AC12ABE9'EV AL' function
AC55AC2F'V AL' function
AC9EAC78'INT' function
ACC4AC9E'ASC' function
ACD3ACAD'INKEY' function
ACDEACB8'EOF' function
ACEAACC4'TRUE' function
ACF7ACD1'NOT' function
AD08ACE2'INSTR(' function
AD8DAD6A'ABS' function
ADB5AD8CUnary '-' function
AE1BADECGet <factor> or <string-factor> at PTRB
AE9CAE6DGet HEX number
AEE3AEB4'TIME' function
AEEFAEC0'PAGE' function
AEF9AECA'FALSE' function
AF00AED1'LEN' function
AF0BAEDC'TOP' function
AF26AEF7'COUNT' function
AF2BAEFC'LOMEM' function
AF32AF03'HIMEM' function
AF78AF49'RND' function
AF85AF56Load IntA from 00,X-03,X
AFB6AF87Spin random number generator
AFCEAF9F'ERL' function
AFD5AFA6'ERR' function
AFDCAFADPerform INKEY
AFE8AFB9'GET' function
AFEEAFBF'GET$' function

AFFE
AFCC'LEFT$(' function
B01DAFEE'RIGHT$(' function
B055B026'INKEY$' function
B05DB02ESet StrA to empty string
B068B039'MID$(' function
B0C3B094'STR$' function
B0F1B0C2'STRING$(' function
B141B112Search for FN/PROC not in list
B1C4B195'FN' function
B27CB24DHandle FN/PROC parameters
B33CB30DPush value and descriptor on STACK
B35BB32CRead value of variable
B3EEB3BD'CHR$' function
B3F6B3C5Set up ERL
B433B402BRK hander
B443B433Default BASIC error handling text
B461B44C'SOUND' statement
B49CB472'ENVELOPE' statement
B4CCB4A0'WIDTH' statement
B4E0B4B1Assign numeric variable
B53AB50EPrint A as a character or token
8570B545Print A as 2-digit HEX number
B571B558Print A as a character (handling COUIX
856AB562Print A as HEX number followed by spXX
B58DB577Print selected LISTO formatting spaces
B5A0B58A'LISTO' command
B5B5B59C'LIST' command
B6AEB695'NEXT' statement
B7DFB7C4'FOR' statement
B8B4B888'GOSUB' statement
B8D5B8B6'RETURN' statement
B8EBB8CC'GOTO' statement
B903B8E4'ON ERROR OFF' statement
B911B8F2'ON ERROR' statement
B934B915'ON' statement
B9B8B99AGet line number, and find it in program
B9EDB9CF'INPUT#' statement
BA62BA44'INPUT' statement
BB00BAE6'RESTORE' statement
BB39BBF1'READ' statement
BBCCEBB1'UNTIL' statement
BBFFBBE4'REPEAT' statement
BC17BBFCInput string to StrA

BC1D
BC02Input string to keyboard buffer
BC42BC25Print CRLF (newline)
BC4ABC2DDelete line in program
BCAABC8DInsert line into program
BD29BD11'RUN' statement
BD38BD20Clear variablesv'stacks
BD52BD3AReset stacks; RESTORE data pointer
BD69BD51Push FP A on ST ACK
BD96BD7EPop real number from STACK
BDA8BD90Push IntA, FPA, or StrA on STACK
BDACBD94Push IntA on ST ACK
BDCABDB2Push StrA on ST ACK
BDE3BDCBPop StrA from STACK
BDF4BDDCDiscard string from STACK
BE04BDEAPop IntA from STACK
BE17BDFFDiscard integer (4 bytes) from STACK
BE23BEOBPop integer from ST ACK to &37 --&3A
BE25BEODPop integer into page zero
BE46BE2EAllocate STACK space; check for 'No room'
BESCBE44Copy IntA into 0,X-3,X
BE6DBESSAdd Y to pointer at &3D,&3E; Set Y=1
BE7ABE62Perform BASIC program load
BE88BE6FTest for 'Bad program'
----BEC2'OSCLI' statement
BEEABEF3'SAVE' statement
BF2DBF24'LOAD' statement
BF33BF2A'CHAIN' statement
BF39BF30'PTR' statement
BF4FBF46'EXT' function
BF50BF47'PTR' function
BF61BF58'BPUT' statement
BF78BF6F'BGET' function
----BF78'OPENIN' function
BF81BF7C'OPENOUT' function
BF85BF80'OPENUP' function ('OPENIN' in BASIC 1)
BF9EBF99'CLOSE' statement
BFAEBFA9Get file handle at PTRA
BFCBBFCFPrint text after 'JSR' to this routine
BFE6BFE4'REPORT'
----BFF9Text: 'Roger'