Acorn System/Atom MOS Entry Points ================================== Address: Subroutine: Instruction: #FFCB OSSHUT JMP (SHTVEC) ; Close a file #FFCE OSFIND JMP (FNDVEC) ; Open a file #FFD1 OSBPUT JMP (BPTVEC) ; Put a byte to open file #FFD4 OSBGET JMP (BGTVEC) ; Get a byte from open file #FFD7 OSSTAR JMP (STRVEC) ; Write open file info #FFDA OSRDAR JMP (RDRVEC) ; Read open file info #FFDD OSSAVE JMP (SAVVEC) ; Save a file #FFE0 OSLOAD JMP (LODVEC) ; Load a file #FFE3 OSRDCH JMP (RDCVEC) ; Read character #FFE6 OSECHO JSR OSRDCH ; Read character and echo #FFE9 OSASCI CMP @#0D ; Write ASCII sequence #FFEB BNE OSWRCH #FFED OSCRLF LDA @#0A ; Write LF-CR Newline sequence #FFEF JSR OSWRCH #FFF2 OSWRCR LDA @#0D ; Write CR #FFF4 OSWRCH JMP (WRCVEC) ; Write a character #FFF7 OSCLI JMP (COMVEC) ; Command Line Interpreter Acorn System/Atom Vectors ========================= Address: Subroutine: Function: #0200 NMIVEC NMI service routine #0202 BRKVEC BRK service routine #0204 IRQVEC IRQ service routine #0206 COMVEC Command Line Interpreter #0208 WRCVEC Write character #020A RDCVEC Read character #020C LODVEC Load file #020E SAVVEC Save file #0210 RDRVEC Read open file info #0212 STRVEC Write open file info #0214 BGTVEC Get byte from open file #0216 BPTVEC Put byte to open file #0218 FNDVEC Open a file #021A SHTVEC Close a file OSCLI #FFF7 Command line interpreter On entry: #0100=-terminated string with command to execute. OSWRCH #FFF4 Write character On entry: A=character to write On exit: all preserved OSWRCR #FFF2 Write CR On exit: A=#0D X,Y preserved OSCRLF #FFED Carriage return, line feed On exit: A=#0D X,Y preserved OSWRCH #FFF9 Write ASCII character On entry: A=character to write On exit: all preserved OSECHO #FFE6 Read character with echo On exit: A=character read X,Y preserved OSRDCH #FFE3 Read character On exit: A=character read X,Y preserved OSLOAD #FFE0 Load file On entry: X=>zero page X+0/1=>file name X+2/3=Load address X+4 :if bit 7=0 use the file's start address CC=Return immediately CS=Wait until IRQ/DMA actions completed On exit: all preserved OSSAVE #FFDD Save file On entry: X=>zero page X+0/1=file name X+2/3=load address X+4/5=execution address X+6/7=start address of data to save X+8/9=(end address)+1 of data to save CC=Return immediately CS=Wait until IRQ/DMA actions completed On exit: all preserved OSRDAR #FFDA Read file's arguments On entry: X=>zero page location Y=handle A=0 - read PTR A=1 - read EXT A=2 - read allocation On exit, X+0-X+3 = returned argument A,X,Y preserved OSSTAR #FFD7 Set file's arguments On entry: X=>zero page location Y=handle A=0 - write PTR X+0-X+3 = argument On exit, A,X,Y preserved OSBGET #FFD4 Get byte On entry: Y=file handle On exit: A=byte read X,Y=preserved CC=valid byte read CS=EOF met OSBPUT #FFD1 Put byte On entry: A=byte to write Y=file handle On exit: all preserved OSFIND #FFCE Open file On entry: X=>zero page X+0/1=file name CS=Open file for input CC=Open file for output On exit: A=file handle, 0 if file not found X,Y=preserved OSSHUT #FFCB Shut file On entry: Y=file handle On exit: all preserved