ROM Routines

The following addresses (except for C2F2, C8E6, FFFA, FFFC and FFFE) are the entry points for some useful routines in BASIC and COS. Note that most are not documented by Acorn, and so may change in future ROMs.

Address  
C2F2 Entry point for BASIC interpreter; locations 5 and 6
should point to the start of the BASIC program
C278 File Shut - just RTS
C589 Print4-byte binary integer from #16,#25,#34, #43 (MSB)
C8E6 Auto start address for routine loaded from tape.
C9D8 BRK service routine; retrieves PC from stack, stores it in 0,
then goes to BASIC routine pointed to by 10,11 (normally C9E7)
F6E2 Plot mode 0
F73B Plot mode 1
F754 Plot mode 2
F76D Plot mode 3
F7AA Plot mode 4. See block zero RAM
F7D1 Output ASCII string from the calling routine following 'JSR F7D1'.
Returns calling routine at first byte with bit 7 = 1. Uses A,X,Y.
F802 Print A as two hex digits. A destroyed.
F87E Convert ASCII hex char in A to binary. A destroyed.
Returns C=1 if char was not ASCII '0' to '9'
F89E Converts ASCII hex string at 0100,Y to 16 bit binary in 0,X and 1,X. Uses 2,X. Destroys A.
Returns with Y pointing to first non-hex character,
Z=1 if first character is not ASCII '0' to '9'
F8EF Interpret string starting at 0100 as an Operating System command.

Uses all registers. Legal commands are: 'CAT', 'LOAD', 'SAVE', 'RUN', 'MON', 'NOMON', 'FLOAD' and 'DOS'. The latter causes a jump to E000

F96E Load cassette file.
Enter with X pointing to the first of five data bytes in zero page RAM;
0,X and 1,X pointing to the file name string,
2,X and 3,X pointing to the first byte to be loaded.
4,X bit 7 should be 0 to use the file's start address
FAE5 Save cassette file.
Enter with X pointing to the first of 10 data bytes in zero page RAM;
0,X and 1,X pointing to the file name string,
2,X and 3,X pointing to the reload address
4,X and 5,X pointing to the execution address
6,X and 7,X pointing to the first byte to be saved
8,X and 9,X pointing to the last byte to be saved plus one
FB83 Wait X/60 seconds. Returns with X=0. Other registers preserved
FBEE Get byte from tape, return with it in A. X and Y preserved
Byte added to checksum at 00DC
FC38 Prints 'PLAY TAPE' if flag C=1, or 'RECORD TAPE' if C=0.
Then waits for a key press before returning.
Returns with A=13, X and Y destroyed.
FC40 Prints 'REWIND TAPE', then waits for a key press
before returning with A=13. X and Y destroyed.
FC7C Put byte to tape. All registers preserved. Byte added to checksum at 00DC.
FD1A Bleep. All registers destroyed.
FD44 Invert character at current cursor position.
See page zero RAM locations DE to E0. A and Y destroyed.
FE52 Write ASCII character in A to printer and VDU (if enabled).
Control characters recognised and acted upon. All registers preserved.
FE55 As FE52 but does not write to printer.
FE66 Wait for start of VDU fly-back (blanking) period. All registers preserved.
FE71 Scan key (except for CTRL, SHIFT, RPT and BRK).
Returns with flag C-1 if no key pressed,
else C=0 and Y = key number. All registers destroyed.
FE94 Wait for key press then return with its ASCII code in A. X and Y preserved.
FEFB Write ASCII character in A to printer (if enabled).
If A=02 (STX), enable printer.
If A=03 (ETX), disable printer.
All registers preserved.
FFCB OSSHUT; normally calls C278 (RTS)
FFCE OSFIND; normally calls FC38
FFD1 OSBPUT; normally calls FC7C
FFD4 OSBGET; normally calls FBEE
FFDD OSSAVE; normally calls FAE5
FFE0 OSLOAD; normally calls F96E
FFE3 OSRDCH; normally calls FE94
FFE6 OSECHO; normally calls FE94 then FE52
FFE9 OSASCI; normally calls FE52
FFED OSCRLF; normally calls FE52 to print CR/LF
FFF7 OSCLI; normally calls F8EF
FFFA NMI vector; normally contains FFC7
FFFC Reset vector; normally contains FF3F
FFFE IRQ/BRK vector; normally contains FFB2

Note: #C014 input routine in #100. Y register must be zero.