BASIC ROM Routines
Last updated
Wherever you see this graphic:
Clicking on it brings you back to this page
BASIC ROM Routines
by Christopher Dewhurst
BASIC IV ROM Routines
By Steve Fewell
I decided to begin something I've been wanting to do for a long time, that is
to produce listings of BASIC 4 ROM's routines, together with detailed descriptions
of how they work.
Please let me know what you think, and whether you'd like to see more like it. If anyone else wants to have a go at writing up with me then please feel free to post (added CJR: send them to 8BS) your own descriptions of routines from BASIC 4 (or another version of BASIC).
If I've made a mistake, and someone wants to correct/expand on something, then please do so.
Latest addtions:
| 03/Mar/2004 | Addition of keywords: PROC, LOCAL, ENDPROC, FN, and routines Search Subroutine Name in Lookup Table, '=' Return from a Function call, Create lookup reference for Subroutine Name, Add subroutine name to FN/PROC variable lookup table, Call Subroutine, Load variable and push its value to the BASIC stack, Set Variable to value from the BASIC Stack, |
| 19/Jan/2004 | Addition of keywords: FOR, NEXT, ON, REPEAT and UNTIL |
| 06/Jan/2004 | Addition of the 'Get Line Number & find Program Address of the Line Number' routine and keywords: TRACE, GOSUB, RETURN, GOTO, RESTORE, READ and IF |
| 28/Dec/2003 | Greetings during this Christmas and new year period! This update contains descriptions for the Trigonometry functions! Addition of keywords: TAN, ACS, ASN, ATN, SIN and COS |
| 05/Oct/2003 | Addition of the 'BASIC error handler' routine and keywords: CHAIN, RUN, LOAD, END, CALL, DELETE, RENUMBER, AUTO, USR, EXT, =PTR, BGET, OPENIN, OPENOUT, OPENUP, EOF, INSTR, STRING$, CHR$, SAVE, OSCLI, CLOSE and BPUT |
| 12/Sep/2003 | Addition of "'[' - Begin Assembly", "Execute '*'-command", "Execute next command line / program statement", 'skip end of program line' and 'Display current Line Number to screen [for TRACE]' routines and keywords: OLD, EXT= and PTR= |
| 20/Aug/2003 | Addition of 'Print Line Number on screen', 'Calculate next Random Number Seed value', 'Output ASCII character/BASIC Token (in ASCII text)' routines and keywords: TIME=, TIME$=, MOVE, DRAW, PLOT, REPORT, VDU, RND, POS, VPOS, EVAL, INT, INKEY, INKEY$, SGN, POINT(, ADVAL, =TIME, =TIME$, LEFT$(, RIGHT$(, MID$(, EDIT, LIST, LISTO |
| 01/Aug/2003 | Addition of 'BASIC ROM Startup Initialisations', 'Find positon of Program Line', 'Tokenise command line text', 'Insert line into Program', 'Remove line from program', 'Check program can be read correctly' and 'Detokenise Line Number' routines and keywords HIMEM=, LOMEM=, PAGE=, CLEAR, GCOL, COLOUR and MODE |
| 10/Jun/2003 | Addition of 'Assemble Assembly Statement', 'Output character to screen' and 'Extract next field' routines and keywords PRINT, PRINT#, CLG, SOUND, ENVELOPE, WIDTH, INPUT and INPUT# |
| 01/May/2003 | Addition of Numeric to ASCII (NUMASC) routine and keywords: NOT, VAL, ASC, ABS, LEN, =PAGE, TOP, COUNT, =LOMEM, =HIMEM, ERL & ERR |
| 09/Apr/2003 | Addition of Disassembler program to the analysis disc images, Added LET & DIM keywords, and added &AD36 (get value routine) |
| 24/Mar/2003 | Addition of Reference Disk Images, SQR & routine [&9909] to evaluate Variables and Arrays (and get address of the required value/variable parameter block). |
| 28/Feb/2003 | First of the Floating-Point Series calculations for functions such as LOG, LN and EXP |
BASIC IV Routines
|
Routine Name |
Start Address |
Address Range |
Comments |
|
8000 |
8000-8022 |
||
|
802B |
802B-8074 |
||
|
8075 |
8075-8084 |
||
|
8085 |
8085-80CC |
||
|
80CD |
80CD-80F8 |
||
|
80F9 |
80F9-8171 |
||
|
8185 |
8185-81CB |
Also includes: 81E0-81E1 |
|
|
81D5 |
81D5-81DF |
||
|
81E2 |
81E2-81F6 |
Also includes: 81CC-81D4 |
|
|
81F7 |
81F7-8241 |
||
|
8242 |
8242-826E |
Also includes: 8272-8274; 827E-82BC; 82BD-82BF; 82C0-82C3 |
|
|
82C4 |
82C4-82DF |
||
|
82E0 |
82E0-830C |
Also includes: 8275-827D |
|
|
831E |
831E-8348 |
||
|
8349 |
8349-8367 |
||
|
8368 |
8368-8455 |
||
|
8456 |
8456-8768 |
||
|
8769 |
8769-884C |
||
|
8920 |
891A-89D3 |
||
|
89EB |
89D4-8CD6 |
Also includes: 884D-891B |
|
|
8CEB |
8CEB-8D03 |
|
|
|
8D04 |
8D04-8D83 |
|
|
|
8D84 |
8D84-8D9A |
|
|
|
8DA0 |
8DA0-8DAE |
|
|
|
8DB2 |
8DAF-8ED4 |
Also includes: 8D9B-8D9F |
|
|
8ED5 |
8ED5-8EDF |
Also includes: 8EEB-8EF0 |
|
|
8EE0 |
8EE0-8EEA |
Also includes: 8CD7-8CEA |
|
|
8EFB |
8EFB-8EFF |
||
|
8F00 |
8F00-8F11 |
||
|
8F12 |
8F12-8F1F |
||
|
8F20 |
8F20-8F24 |
||
|
8F25 |
8F25-8F2C |
||
|
8F2D |
8F2D-8F7C |
||
|
8F7D |
8F7D-8F82 |
Also includes: BEFE-BF13 | |
|
8F83 |
8F83-8FA3 |
||
|
8FA4 |
8FA4-8FAD |
||
|
8FAE |
8FAE-9049 |
||
|
904A |
904A-905F |
Also includes: 9072-9085 |
|
|
9060 |
9060-9071 |
||
|
9086 |
9086-9088 |
||
|
90AB |
90AB-9140 |
Also includes: BE25-BE32 |
|
|
9141 |
9141-918C |
Also includes: BA3C-BA57 |
|
|
918D |
918D-9229 |
Also includes: 927A-9293 |
|
|
9241 |
922A-925A |
Also includes: 9840-9844 |
|
|
925B |
925B-9266 |
||
|
9267 |
9267-926E |
||
|
Get Result of expression from BASIC Text pointer A & convert to Integer |
926F |
926D-9279 |
|
|
92BE |
92BE-9313 |
||
|
9317 |
9314-934C |
||
|
9384 |
934D-9488 |
||
|
9489 |
9489-94B8 |
||
|
9534 |
9534-9604 |
Also includes: 94B9-9502, 9AF6-9B1B, BC43-BC50, BEEF-BEFD |
|
|
960F |
960F-961F |
Also includes: 96B9-96BD |
|
|
9620 |
9620-9633 |
||
|
9634 |
9634-963D |
||
|
963E |
963E-9645 |
||
|
9646 |
9646-9678 |
||
|
9679 |
9679-968D |
||
|
968E |
968E-96A3 |
||
|
Get Integer result of expression and check for closing bracket |
96A7 |
96A7-96AB |
|
|
96AF |
96AC-96B3 |
Also includes: 8EF1-8EF5 |
|
|
96B4 |
96B4-96B8 |
||
|
96BE |
96BE-96D9 |
||
|
96DA |
96D7-96E3 |
||
|
96E4 |
96E4-96FA |
||
|
9703 |
96FB-9731 |
||
|
9741 |
9741-9754 |
||
|
9755 |
9755-975E |
||
|
975F |
975F-97A1 |
||
|
97A2 |
97A2-97A5 |
||
|
97A6 |
97A6-97B0 |
||
|
97B1 |
97B1-97DF |
||
|
97E0 |
97E0-97E6 |
||
|
97E7 |
97E7-97F3 |
||
|
97F4 |
97F4-9807 |
||
|
980D |
9808-983F |
||
|
9845 |
9845-9853 |
||
|
9854 |
9854-9882 |
||
|
9883 |
9883-98AA |
||
|
98AE |
98AB-98BF |
||
|
98D1 |
98D1-98DB |
||
|
98DC |
98DC-98EA |
||
|
9909 |
9909-99AD |
Also includes: 98C1-98D0 |
|
|
99AE |
99AE-99D4 |
||
|
99FE |
99FE-9AE9 |
Also includes: 9503-952B |
|
|
Detokenise the requested Line Number and Set IWA to the Line Number value |
9B1C |
9B1C-9B45 |
|
|
9B52 |
9B52-9B5F |
Also includes: 9B8E-9B95 |
|
|
9B9A |
9B9A-9BA5 |
||
|
9BA6 |
9BA6-9BCE |
Also includes: 9B96-9B99 |
|
|
9BCF |
9BCF-9C04 |
||
|
9C08 |
9C05-9C4A |
||
|
9C4B |
9C4B-9C64 |
|
|
|
9C82 |
9C65-9CC5 |
|
|
|
9CC9 |
9CC6-9D01 |
|
|
|
9D02 |
9D02-9D2E |
|
|
|
9D3B |
9D2F-9D4B |
Also includes: 9D7B-9D88, 9DA9-9DB4, 9E4C-9E57, 9FC1-9FDA, A00F-A026 |
|
|
9D4C |
9D4C-9D65 |
|
|
|
9D66 |
9D66-9D7A |
|
|
|
9D89 |
9D89-9DA8 |
|
|
|
9DB5 |
9DB5-9DCC |
|
|
|
9DCD |
9DCD-9DE0 |
|
|
|
9DE1 |
9DE1-9DEB |
|
|
|
9DEC |
9DEC-9DF4 |
|
|
|
9DF5 |
9DF5-9E06 |
|
|
|
9E07 |
9E07-9E0F |
|
|
|
9E22 |
9E22-9E4B |
|
|
|
9E58 |
9E58-9E64 |
Also includes: 9E91-9EBC |
|
|
9E65 |
9E65-9E90 |
Also includes: 9E4F-9E57 |
|
|
9EBD |
9EBD-9EC9 |
Also includes: 9EE7-9F11; ACC7-ACD6 |
|
|
9ECA |
9ECA-9EE6 |
||
|
9F3B |
9F12-9F63 |
|
|
|
9F64 |
9F64-9FDA |
||
|
9FDB |
9FDB-9FF4 |
|
|
|
9FF5 |
9FF5-9FFC |
||
|
9FFD |
9FFD-A00E |
||
|
A027 |
A027-A07F |
||
|
A085 |
A081-A0C9 |
Also includes: 8021-802A |
|
|
A26C |
A26C-A2BB |
||
|
A118 |
A0CA-A2D9 |
Also Includes: |
|
|
A2E1 |
A2DA-A35C |
||
|
ASCNUM: Handle Exponental values & complete number conversion |
A35D |
A35D-A3F1 |
|
|
A3F2 |
A3F2-A40A |
||
|
A40B |
A40B-A427 |
||
|
A436 |
A436-A477 |
Also Includes: A428-A435 |
|
|
A478 |
A478-A4DF |
||
|
A4E0 |
A4E0-A50C |
||
|
A50D |
A50D-A518 |
||
|
A519 |
A519-A538 |
||
|
A541 |
A539-A56F |
||
|
A570 |
A570-A57E |
||
|
A59B |
A59B-A5BD |
||
|
A5BE |
A5BE-A5E1 |
||
|
A5E9 |
A5E9-A5ED |
Also Includes: A589-A591 |
|
|
A5EE |
A5EE-A5F9 |
||
|
A5FA |
A5FA-A689 |
Also includes: &A5E5 to &A5E8 |
|
|
A68A |
A68A-A68C |
||
|
A68D |
A68D-A694 |
||
|
A695 |
A695-A6A5 |
Also includes &A6AB to &A6B3. |
|
|
A6A6 |
A6A6-A6AA |
||
|
A6B4 |
A6B4-A6C4 |
||
|
A6CF |
A6CF-A745 |
||
|
A746 |
A746-A7B4 |
|
|
|
A7B5 |
A7B5-A860 |
|
|
|
A861 |
A861-A89B |
Also includes: A57F-A588 and A592-A59A |
|
|
A89C |
A89C-A8A0 |
||
|
A8A1 |
A8A1-A8C2 |
||
|
A8C3 |
A8C3-A90C |
||
|
A90D |
A90D-A90D |
|
|
|
A90E |
A90E-A9AC |
|
|
|
A9C8 |
A9C8-A9CE |
|
|
|
A9CF |
A9CF-A9D7 |
|
|
|
A9D8 |
A9D8-A9DE |
|
|
|
A9DF |
A9DF-AA11 |
|
|
|
AA73 |
AA1E-AA7F |
|
|
|
AA80 |
AA80-AA92 |
||
|
AA93 |
AA93-AAA2 |
||
|
AAA3 |
AAA3-AAA8 |
||
|
AAA9 |
AAA9-AABB |
||
|
AABC |
AABC-AAC4 |
||
|
AAC5 |
AAC5-AAC8 |
||
|
AAC9 |
AAC9-AAD6 |
||
|
AAD7 |
AAD7-AADE |
||
|
AADF |
AADF-AAE2 |
||
|
AAE3 |
AAE3-AAE6 |
||
|
AAE7 |
AAE7-AAFE |
||
|
AAFF |
AAFF-AB04 |
||
|
AB05 |
AB05-AB39 |
||
|
AB49 |
AB46-AB4D |
||
|
AB4E |
AB4E-AB88 |
Also includes:AB3A-AB45 |
|
|
AB8A |
AB8A-ABB2 |
Also includes: 830D-831D |
|
|
ABB3 |
ABB3-ABC1 |
||
|
ABC2 |
ABC2-ABCB |
Also includes: AA12-AA1D |
|
|
ABCF |
ABCF-ABDA |
||
|
ABDB |
ABDB-ABDC |
||
|
ABE8 |
ABDD-ABEB |
||
|
ABF5 |
ABEC-AC0D |
||
|
AC0E |
AC0E-AC35 |
||
|
AC36 |
AC36-ACB3 |
||
|
ACB7 |
ACB4-ACBD |
Also includes: ACC4-ACC6 |
|
|
ACBE |
ACBE-ACC3 |
||
|
ACCA |
ACCA-ACD6 |
||
|
ACD7 |
ACD7-ACDD |
||
|
ACDE |
ACDE-ACF7 |
||
|
ACF8 |
ACF8-AD18 |
||
|
AD19 |
AD11-AD35 |
||
|
AD36 |
AD36-AD8B |
||
|
ADAC |
ADAC-ADB6 |
||
|
ADB7 |
ADB7-ADEB |
||
|
ADEC |
ADEC-ADF8 |
||
|
ADF9 |
ADF9-AE07 |
||
|
AE08 |
AE08-AE0D |
||
|
AE11 |
AE0E-AE17 |
||
|
AE1A |
AE18-AE24 |
||
|
AE25 |
AE25-AE28 |
||
|
AE29 |
AE29-AE2E |
||
|
AE2F |
AE2F-AE34 |
||
|
AE35 |
AE35-AE3A |
||
|
AE3B |
AE3B-AE3E |
||
|
AE3F |
AE3F-AE43 |
||
|
AE44 |
AE44-AE56 |
||
|
AE57 |
AE57-AE68 |
||
|
AE69 |
AE69-AE72 |
Also includes: AE8F-AE93 |
|
|
AE73 |
AE73-AE73 |
||
|
AE74 |
AE74-AEB2 |
Also includes: 96A4-96A6 |
|
|
AEB3 |
AEB3-AEBE |
||
|
AEC5 |
AEBF-AF1B |
||
|
AF1C |
AF1C-AF46 |
||
|
AF47 |
AF47-AF82 |
||
|
AF97 |
AF83-B00B |
||
|
B017 |
B017-B067 |
||
|
B068 |
B068-B180 |
||
|
B181 |
B181-B19F |
||
| Load Variable | B1A0 |
B1A0-B1A9 |
|
| Load IWA with Integer from Address [iin] | B1AA |
B1AA-B1C1 |
|
| Load IWA with 1-byte Integer value | B1C2 |
B1C2-B1C6 |
|
| Load FWA with Float Variable (ain) | B1C7 |
B1C7-B1F6 |
|
| Load SWA with String Value | B1F7 |
B1F7-B22E |
|
| CHR$ | B22F |
B22F-B236 |
|
| BASIC Error handler | B278 |
B237-B2A5 |
|
| Reset ON ERROR code pointer | B2A6 |
B2A6-B2C7 |
|
|
B2C8 |
B2C8-B2EB |
||
|
B2EC |
B2EC-B316 |
||
|
B317 |
B317-B324 |
||
|
B32B |
B325-B346 |
Also includes: B360-B388 |
|
| Save Integer to Address | B347 |
B347-B35F |
|
| EDIT | B393 |
B389-B399 |
|
| LIST | B39A |
B39A-B3DC |
Also: B3F3-B4F0 |
| LISTO | B3DD |
B3DD-B3F2 |
|
|
B4F1 |
B4F1-B5F7 |
||
|
B618 |
B618-B6D8 |
||
|
B6D9 |
B6D9-B6F2 |
||
|
B707 |
B707-B71C |
||
|
B71D |
B71D-B738 |
||
|
B75B |
B739-B829 |
||
|
B82A |
B82A-B83B |
||
|
B847 |
B83C-B8B1 |
||
|
B8B6 |
B8B2-B94C |
Also includes: 9299-92BD, BA70-BA91 |
|
|
B94D |
B94D-B974 |
||
|
B97D |
B975-B9F0 |
Also includes: BA13-BA16 |
|
|
BA17 |
BA17-BA3B |
||
|
BA58 |
BA58-BA6F |
||
|
BA92 |
BA92-BA97 |
||
|
BA98 |
BA98-BAEA |
||
|
BAEB |
BAEB-BBAB |
||
|
BBAC |
BBAC-BBE7 |
Also includes: BF14 to BF23 |
|
|
BBE8 |
BBE8-BBF9 |
||
|
BBFA |
BBFA-BC21 |
||
| Push Integer to BASIC Stack | BC26 |
BC22-BC42 |
|
|
BC51 |
BC51-BC69 |
||
|
BC6A |
BC6A-BCD1 |
||
|
BCD2 |
BCD2-BCE5 |
||
| Pop Integer from BASIC Stack | BCE6 |
BCE6-BD05 |
|
| Pop Integer from BASIC Stack (Zp) | BD08 |
BD06-BD1D |
|
| Check for Stack clash with Heap | BD1E |
BD1E-BD30 |
Also includes: BD34-BD36 |
| Output ASCII character or BASIC Token (in ASCII text) to the screen | BD37 |
BD37-BD6B |
Also includes: BD34-BD36 |
| Output character to the screen | BD92 |
BD6C-BDC5 |
Also includes: BD31-BD36 |
| Save Integer to Zero Page Address | BDC6 |
BDC6-BDD6 |
|
| Load/Save named file | BDD7 |
BDD7-BDE4 |
|
| Check Program can be read correctly | BDE5 |
BDE5-BE24 |
Also includes BECF-BEE1 |
| Get Filename and set parameter block Filename and Load address | BE41 |
BE33-BE54 |
|
| SAVE | BE55 |
BE55-BE86 |
|
| OSCLI | BE87 |
BE87-BE92 |
|
| EXT = | BE93 |
BE93-BE96 |
|
| PTR = | BE97 |
BE97-BEAD |
|
| CLOSE | BEAE |
BEAE-BEBC |
|
| BPUT | BEBD |
BEBD-BECE |
|
| Read byte from I/O processor memory location (at the address contained in the IWA) | BEE2 |
BEE2-BEEE |
|
| Floating Point Constant Table | BF24 |
BF24-BFFA |
Disassembly
8000 to 9000 HTML TEXT CSV
9000 to A000 HTML TEXT CSV
A000 to B000 HTML TEXT CSV
B000 to C000 HTML TEXT CSV