>Client/src ! Source for 6502 Tube Client 5 As supplied with External 6502 Second Processor (# Code copyright Acorn Computer 2& Commentary copyright J.G.Harston <: Fload%=&F800: mcode% &900 P: Z/USERV=&200: BRKV=&202:IRQ1V=&204:IRQ2V=&206 d/ CLIV=&208:BYTEV=&20A:WORDV=&20C:WRCHV=&20E n/RDCHV=&210:FILEV=&212:ARGSV=&214:BGetV=&216 x/BPutV=&218:GBPBV=&21A:FINDV=&21C: FSCV=&21E /EVNTV=&220: UPTV=&222: NETV=&224: VduV=&226 / KEYV=&228: INSV=&22A: RemV=&22C: CNPV=&22E $IND1V=&230:IND2V=&232:IND3V=&234 : ERRBUF=&236:INPBUF=&236 : :  Memory addresses: & &EE/F = PROG - Current program & &F0/1 = NUM - hex accumulator $ &F2/3 = MEMTOP - top of memory ? &F4/5 = address of byte transfer address, NMIAddr or ADDR , &F6/7 = ADDR - Data transfer address 2 &F8/9 = String pointer, OSWORD control block J &FA/B = CTRL - OSFILE, OSGBPB control block, PrText string pointer  &FC = IRQ A store " &FD/E => last error , &FF = Escape flag 6: @ P=01 JP%=load%:O%=mcode% T[OPT P*3+4 ^ .RESET h LDX #&00 r .LF802 |9LDA &FF00,X:STA &FF00,X :\ Copy entry block to RAM DEX:BNE LF802  LDX #&36  .LF80D 8LDA LFF80,X:STA USERV,X :\ Set up default vectors DEX:BPL LF80D -TXS:LDX #&F0 :\ Clear stack  .LF819 CLDA &FDFF,X:STA &FDFF,X :\ Copy &FE00-&FEEF to RAM, avoiding :DEX:BNE LF819 :\ Tube registers at &FEFx 5LDY #RESET 255:STY &F8 :\ Point to start of ROM LDA #RESET 256:STA &F9 9.LF82A :\ Copy rest of ROM to RAM 4LDA (&F8),Y:STA (&F8),Y :\ Copy a page to RAM 4INY:BNE LF82A :\ Loop for 256 bytes 8INC &F9:LDA &F9 :\ Inc. address high byte :CMP #&FE:BNE LF82A :\ Loop from &F800 to &FDFF & LDX #&10 0 .LF83B :8LDA LF859,X:STA &0100,X :\ Copy jump code to &100 DDEX:BPL LF83B N5LDA &EE:STA &F6 :\ Copy &EE/F to &F6/7 XLDA &EF:STA &F7 b3LDA #&00:STA &FF :\ Clear Escape flag lESTA &F2:LDA #&F8:STA &F3 :\ Set memtop to start of ROM at &F800 vEJMP &0100 :\ Jump via low memory to page ROM out  ,\ Executed in low memory to page ROM out ,\ --------------------------------------  .LF859 FLDA TubeS1:CLI :\ Check Tube R1 status to page ROM out  .LF85D CJMP LF860 :\ Jump to initilise I/O with banner   .LF860 8JSR PrText :\ Display startup banner &EQUB 10:EQUS "Acorn TUBE 6502 64K" "EQUB 10:EQUB 10:EQUB 13:EQUB 0 NOP @LDA #CmdOSLoop 255 :\ Next time RESET is soft entered,  4STA LF85D+1 :\ banner not printed LDA #CmdOSLoop 256  STA LF85D+2 *6JSR WaitR2 :\ Wait for Acknowledge 4F :\ Otherwise, enter command prompt loop H R\ Minimal Command prompt \\ ====================== f.CmdOSLoop p0LDA #"*":JSR OSWRCH :\ Print '*' prompt zLDX #LF95D 255 LDY #LF95D 256 5LDA #&00:JSR OSWORD :\ Read line to INPBUF BCS CmdOSEscape LDX #INPBUF 255 /LDY #INPBUF 256 :\ Execute command copyright message V\ `\ Now check for &00,"(C)" j@LDY #&00:LDA (&FD),Y:BNE LF8FA :\ Jump if no initial &00 t8INY:LDA (&FD),Y:CMP #&28:BNE LF8FA :\ Jump if no '(' ~8INY:LDA (&FD),Y:CMP #&43:BNE LF8FA :\ Jump if no 'C' 8INY:LDA (&FD),Y:CMP #&29:BNE LF8FA :\ Jump if no ')' \ \ &00,"(C)" exists 6LDY #&06:LDA (&EE),Y :\ Get ROM type < #&4F:CMP #&40:BCC NotLanguage :\ b6=0, not a language F #&0D:BNE Not6502Code :\ type<>0 and <>2, not 6502 code  .LF8FA =LDA #&01:JMP (&00F2) :\ Enter code with A=1 \ D\ Any existing error handler will probably have been overwritten 9\ Set up new error handler before generating an error .NotLanguage =LDA #ErrorHandler 255:STA BRKV+0 :\ Claim error handler  &LDA #ErrorHandler 256:STA BRKV+1 3BRK:EQUB 0:EQUS "This is not a language":EQUB 0  (.Not6502Code 2=LDA #ErrorHandler 255:STA BRKV+0 :\ Claim error handler <&LDA #ErrorHandler 256:STA BRKV+1 F3BRK:EQUB 0:EQUS "I cannot run this code":EQUB 0 P Z.ErrorHandler d-LDX #&FF:TXS :\ Clear stack nJSR OSNEWL:LDY #&01 x .LF94D 4LDA (&FD),Y:BEQ LF957 :\ Print error string JSR OSWRCH:INY:BNE LF94D  .LF957 8JSR OSNEWL:JMP CmdOSLoop :\ Jump to command prompt  ,\ Control block for command prompt input ,\ --------------------------------------  .LF95D >EQUW INPBUF :\ Input text to INPBUF at &236 6EQUB &CA :\ Up to &CA characters 2EQUB &20:EQUB &FF :\ Min=&20, Max=&FF   \ MOS ERFACE \ ============= \ "\ ,.\ OSWRCH - Send character to output stream 6.\ ======================================== @\ On entry, A =character J\ On exit, A =preserved T\ ^\ Tube data character -- h\ r .osWRCH |5BIT TubeS1 :\ Read Tube R1 status 3NOP:BVC osWRCH :\ Loop until b6 set ;STA TubeR1:RTS :\ Send character to Tube R1   3\ OSRDCH - Wait for character from input stream 3\ ============================================= &\ On exit, A =char, Cy=Escape flag \ $\ Tube data &00 -- Carry Char \  .osRDCH ;LDA #&00:JSR SendR2 :\ Send command &00 - OSRDCH 6.WaitCarryChar :\ Wait for Carry and A 0JSR WaitR2:ASL A :\ Wait for carry  .WaitR2 =BIT TubeS2:BPL WaitR2 :\ Loop until Tube R2 has data &1LDA TubeR2 :\ Fetch character 0.NullReturn :RTS D N X\ Skip Spaces b\ =========== l.SkipSpaces1 vINY .SkipSpaces (LDA (&F8),Y:CMP #&20:BEQ SkipSpaces1 RTS   \ Scan hex \ ========  .ScanHex 7LDX #&00:STX &F0:STX &F1 :\ Clear hex accumulator  .LF98C 7LDA (&F8),Y :\ Get current character ,CMP #&30:BCC LF9B1 :\ <'0', exit >CMP #&3A:BCC LF9A0 :\ '0'..'9', add to accumulator = #&DF:SBC #&07:BCC LF9B1:\ Convert letter, if <'A', exit  ,CMP #&40:BCS LF9B1 :\ >'F', exit  .LF9A0  %ASL A:ASL A:ASL A:ASL A :\ *16 *:LDX #&03 :\ Prepare to move 3+1 bits 4 .LF9A6 >string .SendStringF8  LDY #&00  .LF9B8 7BIT TubeS2:BVC LF9B8 :\ Wait for Tube R2 free ;LDA (&F8),Y:STA TubeR2 :\ Send character to Tube R2 6INY:CMP #&0D:BNE LF9B8 :\ Loop until sent ?LDY &F9:RTS :\ Restore Y from &F9 and return   \ - Execute command \ ======================= "\ On entry, XY=>command string $\ On exit, XY= preserved .\ 8 .osCLI B?PHA:STX &F8:STY &F9 :\ Save A, &F8/9=>command string L LDY #&00 V .LF9D1 `JSR SkipSpaces:INY j5CMP #"*":BEQ LF9D1 :\ Skip spaces and stars t: #&DF:TAX :\ Ignore case, and save in X ~4LDA (&F8),Y :\ Get next character 3CPX #"G":BEQ CmdGO :\ Jump to check '*GO' @CPX #"H":BNE osCLI_IO :\ Not "H---", jump to pass to Tube 4CMP #".":BEQ CmdHELP :\ "H.", jump to do *Ǔ + #&DF :\ Ignore case ACMP #"E":BNE osCLI_IO :\ Not "HE---", jump to pass to Tube 4INY:LDA (&F8),Y :\ Get next character 5CMP #".":BEQ CmdHELP :\ "HE.", jump to do *Ǔ + #&DF :\ Ignore case BCMP #"L":BNE osCLI_IO :\ Not "HEL---", jump to pass to Tube 4INY:LDA (&F8),Y :\ Get next character 6CMP #".":BEQ CmdHELP :\ "HEL.", jump to do *Ǔ + #&DF :\ Ignore case CCMP #"P":BNE osCLI_IO :\ Not "HELP---", jump to pass to Tube 4INY:LDA (&F8),Y :\ Get next character + #&DF :\ Ignore case GCMP #"A":BCC CmdHELP :\ "HELP" terminated by non-letter, do *Ǔ (GCMP #"[":BCC osCLI_IO :\ "HELP" followed by letter, pass to Tube 2 <&\ *Help - Display help information F&\ -------------------------------- P .CmdHELP Z4JSR PrText :\ Print help message d)EQUB 10:EQUB 13:EQUS "6502 TUBE 1.10" nEQUB 10:EQUB 13 xLNOP :\ Drop through to pass '*Ǔ' command to Tube   #\ - Send command line to host '\ ================================= %\ On entry, &F8/9=>command string \ /\ Tube data &02 string &0D -- &7F or &80 \ .osCLI_IO 6LDA #&02:JSR SendR2 :\ Send command &02 - >JSR SendStringF8 :\ Send command string at &F8/9 .osCLI_Ack :JSR WaitR2 :\ Wait for acknowledgement &7F, X, Y, Carry=returned values N\ X .osBYTE b7CMP #&80:BCS ByteHigh :\ Jump for long OSBYTEs l\ v!\ Tube data &04 X A -- X \ PHA:LDA #&04 .LFA7A 7BIT TubeS2:BVC LFA7A :\ Wait for Tube R2 free =STA TubeR2 :\ Send command &04 - OSBYTELO .LFA82 7BIT TubeS2:BVC LFA82 :\ Wait for Tube R2 free 7STX TubeR2:PLA :\ Send single parameter .LFA8B 7BIT TubeS2:BVC LFA8B :\ Wait for Tube R2 free /STA TubeR2 :\ Send function .LFA93 ?BIT TubeS2:BPL LFA93 :\ Wait for Tube R2 data present 2LDX TubeR2:RTS :\ Get return value   .ByteHigh 7CMP #&82:BEQ Byte82 :\ Read memory high word *7CMP #&83:BEQ Byte83 :\ Read bottom of memory 44CMP #&84:BEQ Byte84 :\ Read top of memory >\ H&\ Tube data &06 X Y A -- Cy Y X R\ \PHA:LDA #&06 f .LFAAB p7BIT TubeS2:BVC LFAAB :\ Wait for Tube R2 free z=STA TubeR2 :\ Send command &06 - OSBYTEHI .LFAB3 7BIT TubeS2:BVC LFAB3 :\ Wait for Tube R2 free 2STX TubeR2 :\ Send parameter 1 .LFABB 7BIT TubeS2:BVC LFABB :\ Wait for Tube R2 free 2STY TubeR2 :\ Send parameter 2 PLA .LFAC4 7BIT TubeS2:BVC LFAC4 :\ Wait for Tube R2 free /STA TubeR2 :\ Send function ICMP #&8E:BEQ CheckAck :\ If select language, check to enter code 9CMP #&9D:BEQ LFAEF :\ Fast return with Fast /PHA :\ Save function  .LFAD5 ?BIT TubeS2:BPL LFAD5 :\ Wait for Tube R2 data present +LDA TubeR2:ASL A:PLA :\ Get Carry $ .LFADF .?BIT TubeS2:BPL LFADF :\ Wait for Tube R2 data present 86LDY TubeR2 :\ Get return high byte B .LFAE7 L?BIT TubeS2:BPL LFAE7 :\ Wait for Tube R2 data present V5LDX TubeR2 :\ Get return low byte ` .LFAEF jRTS t ~B.Byte84:LDX &F2:LDY &F3:RTS :\ Read top of memory from &F2/3 :.Byte83:LDX #&00:LDY #&08:RTS :\ Read bottom of memory E.Byte82:LDX #&00:LDY #&00:RTS :\ Return &0000 as memory high word    \ OSWORD - Various functions  \ ========================== \ On entry, A =function !\ XY=>control block \  .osWORD 6STX &F8:STY &F9 :\ &F8/9=>control block =TAY:BEQ RDLINE :\ OSWORD 0, jump to read line PHA:LDY #&08  .LFB09 9BIT TubeS2:BVC LFB09 :\ Loop until Tube R2 free ;STY TubeR2 :\ Send command &08 - OSWORD ( .LFB11 29BIT TubeS2:BVC LFB11 :\ Loop until Tube R2 free LDA (&F8),Y:STA TubeR2 :\ Send byte from control block control block \ On exit, A =undefined ,\ Y =length of returned string $\ Cy=0 ok, Cy=1 Escape \ 5\ Tube data &0A block -- &FF or &7F string &0D \ & .RDLINE 0;LDA #&0A:JSR SendR2 :\ Send command &0A - RDLINE : LDY #&04 D .LFB7E N7BIT TubeS2:BVC LFB7E :\ Wait for Tube R2 free X4LDA (&F8),Y:STA TubeR2 :\ Send control block b2DEY:CPY #&01:BNE LFB7E :\ Loop for 4, 3, 2 l?LDA #&07:JSR SendR2 :\ Send &07 as address high byte vCLDA (&F8),Y:PHA :\ Get text buffer address high byte DEY  .LFB96 7BIT TubeS2:BVC LFB96 :\ Wait for Tube R2 free >STY TubeR2 :\ Send &00 as address low byte BLDA (&F8),Y:PHA :\ Get text buffer address low byte 3LDX #&FF:JSR WaitR2 :\ Wait for response 9CMP #&80:BCS RdLineEscape :\ Jump if Escape returned 8PLA:STA &F8:PLA:STA &F9 :\ Set &F8/9=>text buffer  LDY #&00  .RdLineLp ?BIT TubeS2:BPL RdLineLp :\ Wait for Tube R2 data present :LDA TubeR2:STA (&F8),Y :\ Store returned character 1INY:CMP #&0D:BNE RdLineLp :\ Loop until ?LDA #&00:DEY:CLC:INX :\ Return A=0, Y=len, X=00, Cy=0  RTS :  .RdLineEscape *?PLA:PLA:LDA #&00 :\ Return A=0, Y=len, X=FF, Cy=1 4RTS > H R%\ OSARGS - Read info on open file \%\ =============================== f\ On entry, A =function p*\ X =>data word in zero page z\ Y =handle !\ On exit, A =returned value \ X preserved \ Y preserved \ <\ Tube data &0C handle block function -- result block \  .osARGS ;PHA:LDA #&0C:JSR SendR2 :\ Send command &0C - OSARGS  .LFBD2 9BIT TubeS2:BVC LFBD2 :\ Loop until Tube R2 free -STY TubeR2 :\ Send handle 0LDA &03,X:JSR SendR2 :\ Send data word LDA &02,X:JSR SendR2 LDA &01,X:JSR SendR2 LDA &00,X:JSR SendR2 /PLA:JSR SendR2 :\ Send function $5JSR WaitR2:PHA :\ Get and save result .3JSR WaitR2:STA &03,X :\ Receive data word 8JSR WaitR2:STA &02,X BJSR WaitR2:STA &01,X LJSR WaitR2:STA &00,X Vfilename !\ On exit, A =zero or handle \ 4\ Tube data &12 function string &0D -- handle (\ &12 &00 handle -- &7F \  .osFIND ;PHA:LDA #&12:JSR SendR2 :\ Send command &12 - OSFIND /PLA:JSR SendR2 :\ Send function 9CMP #&00:BNE OPEN :\ If <>0, jump to do OPEN -PHA:TYA:JSR SendR2 :\ Send handle OJSR WaitR2:PLA:RTS :\ Wait for acknowledge, restore regs and return  .OPEN /JSR SendR2String :\ Send pathname control block \ On exit, A =result %\ control block updated \ A\ Tube data &14 block string function -- result block \  .osFILE 6STY &FB:STX &FA :\ &FA/B=>control block &;PHA:LDA #&14:JSR SendR2 :\ Send command &14 - OSFILE 0 LDY #&11 : .LFC5F D4LDA (&FA),Y:JSR SendR2 :\ Send control block N3DEY:CPY #&01:BNE LFC5F :\ Loop for &11..&02 XDEY:LDA (&FA),Y:TAX bcontrol block !\ On exit, A =returned value  (\ control block updated \  <\ Tube data &16 block function -- block Carry result *\ 4 .osGBPB >6STY &FB:STX &FA :\ &FA/B=>control block H;PHA:LDA #&16:JSR SendR2 :\ Send command &16 - OSGBPB R LDY #&0C \ .LFC9A f4LDA (&FA),Y:JSR SendR2 :\ Send control block p3DEY:BPL LFC9A :\ Loop for &0C..&00 z/PLA:JSR SendR2 :\ Send function  LDY #&0C  .LFCA8 8JSR WaitR2:STA (&FA),Y :\ Get control block back 3DEY:BPL LFCA8 :\ Loop for &0C..&00 3LDY &FB:LDX &FA :\ Restore registers >JMP WaitCarryChar :\ Jump to get Carry and result   .Unsupported "BRK:EQUB 255:EQUS "Bad":EQUB 0   "\ OSWORD control block lengths "\ ============================ .WordLengthsLo 'EQUB &00:EQUB &05:EQUB &00:EQUB &05 $'EQUB &02:EQUB &05:EQUB &08:EQUB &0E .'EQUB &04:EQUB &01:EQUB &01:EQUB &05 8'EQUB &00:EQUB &01:EQUB &20:EQUB &10 B'EQUB &0D:EQUB &00:EQUB &04:EQUB &80 L.WordLengthsHi V'EQUB &05:EQUB &00:EQUB &05:EQUB &00 `'EQUB &05:EQUB &00:EQUB &00:EQUB &00 j'EQUB &05:EQUB &09:EQUB &05:EQUB &00 t'EQUB &08:EQUB &18:EQUB &00:EQUB &01 ~'EQUB &0D:EQUB &80:EQUB &04:EQUB &80   \ Interrupt Handler \ ================= .InterruptHandler >STA &FC:PLA:PHA :\ Save A, get flags from stack ; #&10:BNE BRKHandler :\ If BRK, jump to BRK handler after BRK opcode F8PLA:TAX:LDA &FC :\ Restore X, get saved A PECLI:JMP (BRKV) :\ Restore IRQs, jump to Error Handler Z d n,\ Interrupt generated by data in Tube R1 x,\ --------------------------------------  .LFD18 @LDA TubeR1:BMI LFD39 :\ b7=1, jump to set Escape state 0TYA:PHA:TXA:PHA :\ Save registers >JSR LFE80:TAY :\ Get Y parameter from Tube R1 >JSR LFE80:TAX :\ Get X parameter from Tube R1 ?JSR LFE80 :\ Get event number from Tube R1 CJSR LFD36:PLA:TAX:PLA:TAY :\ Dispatch event, restore registers BLDA &FC:RTI :\ Restore A, return from interrupt  .LFD36 JMP (EVNTV)  .LFD39 9ASL A:STA &FF :\ Set Escape flag from b6 BLDA &FC:RTI :\ Restore A, return from interrupt   ,\ Interrupt generated by data in Tube R4 ",\ -------------------------------------- , .LFD3F 6>LDA TubeR4:BPL LFD65 :\ b7=0, jump for data transfer @CLI J .LFD45 T:BIT TubeS2:BPL LFD45 :\ Wait for data in Tube R2 ^LDA TubeR2 hBLDA #&00:STA ERRBUF:TAY :\ Store BRK opcode in error buffer r2JSR WaitR2:STA ERRBUF+1 :\ Get error number | .LFD59 BINY:JSR WaitR2 :\ Store bytes fetched from Tube R2 7STA ERRBUF+1,Y:BNE LFD59 :\ Loop until final zero GJMP ERRBUF :\ Jump to error block to generate error  0\ Data transfer initiated by IRQ via Tube R4 0\ ------------------------------------------  .LFD65 4INY:BNE LFDCF :\ Loop for 256 bytes H .LFDDF R7BIT TubeS3:BPL LFDDF :\ Wait for Tube R3 free \6STA TubeR3 :\ Send final sync byte f .LFDE7 p>PLA:TAY:LDA &FC:RTI :\ Restore registers and return z %\ Read 256 bytes from Tube via R3 %\ -------------------------------  .LFDEC  LDY #&00  .LFDEE ?LDA TubeS3: #&80:BPL LFDEE:\ Wait for Tube R3 data present 9LDA TubeR3 :\ Fetch byte from Tube R3  .NMI7Addr CSTA &FFFF,Y:INY:BNE LFDEE :\ Store byte and loop for 256 bytes FBEQ LFDE7 :\ Jump to restore registers and return  /\ Transfer 0 - Transfer single byte to Tube /\ -----------------------------------------  .NMI0 (PHA :\ Save A  .NMI0Addr $>LDA &FFFF:STA TubeR3 :\ Get byte and send to Tube R3 .LDA (&F6),Y:STA TubeR3 :\ Get byte and send to Tube R3 LDA (&F6),Y:STA TubeR3 :\ Get byte and send to Tube R3 PLA:TAY:PLA:RTI :\ Restore registers and return  $\ Data transfer address pointers $\ ------------------------------  .LFE60 3EQUB (NMI0Addr+1) 255:EQUB (NMI1Addr+1) 255 ,EQUB &00F6 255 :EQUB &00F6 255 ,EQUB &00F6 255 :EQUB &00F6 255 3EQUB (NMI6Addr+1) 255:EQUB (NMI7Addr+1) 255  .LFE68 3EQUB (NMI0Addr+1) 256:EQUB (NMI1Addr+1) 256 ,EQUB &00F6 256 :EQUB &00F6 256 ",EQUB &00F6 256 :EQUB &00F6 256 ,3EQUB (NMI6Addr+1) 256:EQUB (NMI7Addr+1) 256 6 @%\ Data transfer routine addresses J%\ ------------------------------- T .LFE70 ^&EQUB NMI0 255 :EQUB NMI1 255 h&EQUB NMI2 255 :EQUB NMI3 255 r)EQUB NMI_Ack 255:EQUB NMI_Ack 255 |)EQUB NMI_Ack 255:EQUB NMI_Ack 255  .LFE78 &EQUB NMI0 256 :EQUB NMI1 256 &EQUB NMI2 256 :EQUB NMI3 256 )EQUB NMI_Ack 256:EQUB NMI_Ack 256 )EQUB NMI_Ack 256:EQUB NMI_Ack 256   B\ Wait for byte in Tube R1 while allowing requests via Tube R4 B\ ============================================================  .LFE80 FBIT TubeS1:BMI LFE94 :\ If data in Tube R1, jump to fetch it  .LFE85 BBIT TubeS4 :\ Check if data present in Tube R4 NBPL LFE80 :\ If nothing there, jump back to check Tube R1 BLDA &FC :\ Save IRQ's A store in A register LPHP:CLI:PLP :\ Allow an IRQ through to process R4 request &QSTA &FC:JMP LFE80 :\ Restore IRQ's A store and jump back to check R1 0 .LFE94 :DLDA TubeR1:RTS :\ Fetch byte from Tube R1 and return D N X\ Print embedded string b\ ===================== l .PrText v8PLA:STA &FA:PLA:STA &FB :\ &FA/B=>embedded string LDY #&00 .LFEA0 3INC &FA:BNE LFEA6:INC &FB :\ Increment address .LFEA6 =LDA (&FA),Y:BMI LFEB0 :\ Get character, exit if >&7F HJSR OSWRCH:JMP LFEA0 :\ Print character and loop back for more .LFEB0 @JMP (&00FA) :\ Jump back to code after string   \ Null NMI code \ ------------- .NMI_Ack !CSTA TubeR3:RTI :\ Store to TubeR3 to acknowlege NMI !  ! ! \ Spare space !*\ =========== !4EQUS &FEF0-P%,255) !> !H !R\ I/O Space !\\ ========= !fEQUS 8,0) !p !z\ Tube I/O Registers !\ ================== !.TubeS1 :\ &FEF8 :EQUB 0 !.TubeR1 :\ &FEF9 :EQUB 0 !.TubeS2 :\ &FEFA :EQUB 0 !.TubeR2 :\ &FEFB :EQUB 0 !.TubeS3 :\ &FEFC :EQUB 0 !.TubeR3 :\ &FEFD :EQUB 0 !.TubeS4 :\ &FEFE :EQUB 0 !.TubeR4 :\ &FEFF :EQUB 0 ! ! !\ Spare space !\ =========== " .LFF00 "EQUS &FF80-P%,255) " "$ ".\ AULT VECTOR TABLE "8\ ==================== "B .LFF80 "L)EQUW Unsupported :\ &200 - USERV "V(EQUW ErrorHandler :\ &202 - BRKV "`)EQUW IRQ1Handler :\ &204 - IRQ1V "j)EQUW Unsupported :\ &206 - IRQ2V "t(EQUW osCLI :\ &208 - CLIV "~)EQUW osBYTE :\ &20A - BYTEV ")EQUW osWORD :\ &20C - WORDV ")EQUW osWRCH :\ &20E - WRCHV ")EQUW osRDCH :\ &210 - RDCHV ")EQUW osFILE :\ &212 - FILEV ")EQUW osARGS :\ &214 - ARGSV ")EQUW osBGET :\ &216 - BGetV ")EQUW osBPUT :\ &218 - BPutV ")EQUW osGBPB :\ &21A - GBPBV ")EQUW osFIND :\ &21C - FINDV "(EQUW Unsupported :\ &21E - FSCV ")EQUW NullReturn :\ &220 - EVNTV "(EQUW Unsupported :\ &222 - UPTV #(EQUW Unsupported :\ &224 - NETV # (EQUW Unsupported :\ &226 - VduV #(EQUW Unsupported :\ &228 - KEYV #(EQUW Unsupported :\ &22A - INSV #((EQUW Unsupported :\ &22C - RemV #2(EQUW Unsupported :\ &22E - CNPV #<)EQUW NullReturn :\ &230 - IND1V #F)EQUW NullReturn :\ &232 - IND2V #P)EQUW NullReturn :\ &234 - IND3V #Z #d).VECDEF :\ &FFB6 :EQUB &36:EQUW LFF80 #n%.OSXXXX :\ &FFB9 :JMP Unsupported #x%.OSXXXX :\ &FFBC :JMP Unsupported #%.OSXXXX :\ &FFBF :JMP Unsupported #%.OSXXXX :\ &FFC2 :JMP Unsupported #%.OSXXXX :\ &FFC5 :JMP Unsupported # .NVRDCH :\ &FFC8 :JMP osRDCH # .NVWRCH :\ &FFCB :JMP osWRCH # #!.OSFIND :\ &FFCE :JMP (FINDV) #!.OSGBPB :\ &FFD1 :JMP (GBPBV) #!.OSBPUT :\ &FFD4 :JMP (BPutV) #!.OSBGET :\ &FFD7 :JMP (BGetV) #!.OSARGS :\ &FFDA :JMP (ARGSV) #!.OSFILE :\ &FFDD :JMP (FILEV) # $!.OSRDCH :\ &FFE0 :JMP (RDCHV) $).OSASCI :\ &FFE3 :CMP #&0D:BNE OSWRCH $).OSNEWL :\ &FFE7 :LDA #&0A:JSR OSWRCH $".OSWRCR :\ &FFFC :LDA #&0D $,!.OSWRCH :\ &FFFE :JMP (WRCHV) $6!.OSWORD :\ &FFF1 :JMP (WORDV) $@!.OSBYTE :\ &FFF4 :JMP (BYTEV) $J .OS_CLI :\ &FFF7 :JMP (CLIV) $T $^9.NMIV :\ &FFFA :EQUW NMI0 :\ NMI Vector $h;.RESETV :\ &FFFC :EQUW RESET :\ RESET Vector $r9.IRQV :\ &FFFE :EQUW InterruptHandler :\ IRQ Vector $|]: $="Save Client "+~mcode%+" "+~O%+" "+~load%+" "+~load% $ : $ *Quit