REM > Em65v064/src REM Source for 6502 Tube Client for 65Tube 6502 CoPro emulator : REM Source for 65Tube Tube client : load%=&F800:DIM mcode% &900 : USERV=&200: BRKV=&202:IRQ1V=&204:IRQ2V=&206 CLIV=&208:BYTEV=&20A:WORDV=&20C:WRCHV=&20E RDCHV=&210:FILEV=&212:ARGSV=&214:BGetV=&216 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 : FOR P=0TO1 P%=load%:O%=mcode% [OPT P*3+4 \ &EE/F= \ &F0/1=>membot, if &F0<>0, membot=0000, memtop=0000 \ &F2/3=>command string \ &F4/5=>memtop \ &F6/7= readhex accumulator, ";params" pointer \ &F8/9=>control block \ &FA/B=>String to print with PrString \ &FC = IRQ A store \ &FD/E=>last error \ &FF = escape flag \ &0236= command input buffer \ &03xx= bit16-bit23 of Turbo65 (zp),Y addresses \ &03F3= b16-b23 of (&F2),Y command string pointer \ &03F5= b16-b23 of (&F4),Y memtop pointer \ &03F9= b16-b23 of (&F8),Y control block pointer \ &03FB= b16-b23 of (&FA),Y string pointer \ &03FE= b16-b23 of (&FD),Y error pointer \ Emulator opcodes \ &03 - OSCLI \ &13 - OSBYTE \ &23 - OSWORD \ &33 - OSWRCH \ &43 - OSRDCH \ &53 - OSFILE \ &63 - OSARGS \ &73 - OSBGET \ &83 - OSBPUT \ &93 - OSGBPB \ &A3 - OSFIND \ &B3 - Called by *QUIT \ &C3 - Called by *BASIC and OSBYTE 142 \ &D3 \ &E3 \ &F3 \ *OS - Enter command prompt \ ========================== .CmdOS JSR ErrorInit:JSR OSNEWL :\ Point BRKV to ErrorHandler JSR HelpBanner:JSR OSNEWL :\ Display Emulator banner LDY #&04:JSR OSByteA3 :\ Ask host something TYA:BNE JumpToCode :\ If Y<>0, enter code at XY .CmdOSLoop JSR PrText :\ Display prompt EQUS "65*":NOP LDA #&00 LDX #LF84A AND 255 LDY #LF84A DIV 256 JSR OSWORD:BCS OSEscape :\ Input a command LDX #&36:LDY #&02:JSR OS_CLI :\ Execute command JMP CmdOSLoop :\ Jump back for another \ *BASIC \ ====== .CmdBASIC EQUB &C3 :\ Pass to host \ NMI Handler \ =========== .NMIHandler LDY #&04:JSR OSByteA3 :\ Ask host something TYA:BEQ CmdOS :\ If Y=0, enter command prompt .JumpToCode JMP EnterCodeXY :\ Y<>0, enter code at XY .OSEscape LDA #&7E:JSR OSBYTE :\ Ack. escape BRK:EQUB 17:EQUS "Escape":BRK .LF84A EQUW &0236 :\ Input buffer at &0236 EQUB &C9 :\ Max. &C9 characters EQUB &20 :\ Minimum character EQUB &FF :\ Maximum character .RESET LDX #&FF:TXS :\ Clear stack JSR LF87F :\ Reset vectors and set memory limits LDY #&06:JSR OSByteA3 :\ Ask host something TYA:BNE OscliXY :\ If Y<>0, execute command at XY \ If Y=0, display startup banner and enter command prompt \ If Y<>0, XY=>command to execute JSR PrText :\ Print startup banner EQUB 10:EQUS "Acorn 6502 Tube" EQUB 10:EQUB 10:EQUB 13 NOP JMP CmdOS :\ Jump to command prompt \ Will then call display help banner, \ then calls OsByteA3,4 for any entry address .OscliXY JSR ErrorInit :\ Set up error handler JSR OS_CLI:JMP CmdQUIT :\ Execute command then quit \ Reset vectors and set memory limits \ =================================== .LF87F CLD:LDX #&35 .LF882 LDA LFB87,X:STA &0200,X :\ Copy from default vectors DEX:BPL LF882 STZ &FF:STZ &F0 :\ Clear escape flag LDX #&08:STX &F1 :\ Set F0/1=>bottom of memory at &0800 LDX #&00:LDY #&F8 :\ XY=&F800 STX &F4:STY &F5 :\ Set F4/5=>top of memory at &F800 RTS \ Interupt handler \ ================ .InterruptHandler STA &FC:PLA:PHA :\ Save A, get flags from stack AND #&10:BNE BRKHandler :\ If BRK, jump to BRK handler JMP (IRQ1V) :\ Continue via IRQ1V handler .IRQ1Handler JMP (IRQ2V) :\ No handlers, pass staight on to IRQ2V .BRKHandler TXA:PHA :\ Save X TSX:LDA &0103,X :\ Get address from stack CLD:SEC:SBC #&01:STA &FD LDA &0104,X:SBC #&00:STA &FE :\ &FD/E=>after BRK opcode LDA #&00:STA &03FE :\ Error block at (&FD),Y is in block &00 PLA:TAX:LDA &FC :\ Restore X, get saved A CLI:JMP (BRKV) :\ Restore IRQs and jump to Error Handler \ Default error handler \ ===================== .ErrorHandler LDX #&FF:TXS :\ Clear stack INX:STX &03FE :\ Error block at (&FD),Y is in block &00 CLI:JSR OSNEWL LDY #&01 .LF8D7 LDA (&FD),Y:BEQ LF8E1 :\ Print error string JSR OSWRCH:INY:BNE LF8D7 .LF8E1 JSR OSNEWL:JMP CmdOSLoop :\ Jump to command prompt \ *QUIT \ ===== .CmdQUIT EQUB &B3 :\ Pass to host .OSByteA3 LDA #&A3:LDX #&F3 :\ OSBYTE &A3,&F3 EQUB &13 :\ Host OSBYTE RTS \ Scan hex \ ======== .ScanHex LDX #&00:STX &F6:STX &F7 :\ Clear hex accumulator STX &03F3 :\ String at (&F2),Y is in block &00 .LF8F7 LDA (&F2),Y :\ Get current character SEC:SBC #&30:BCC LF921 :\ <'0', exit CMP #&0A:BCC LF90E :\ '0'..'9', add into accumator AND #&DF:SBC #&07 :\ Ignore case, convert letters CMP #&0A:BCC LF921 :\ <'A', exit CMP #&10:BCS LF921 :\ >'F', exit .LF90E ASL A:ASL A:ASL A:ASL A :\ *16 LDX #&03 .LF914 ASL A:ROL &F6:ROL &F7 :\ Move bits into accumulator BCS LF959 :\ Overflowed, jump to error DEX:BPL LF914 :\ Loop for four bits INY:BNE LF8F7 :\ Move to next character .LF921 JMP SkipSpaces :\ Skip past any final spaces and exit \ Scan hex, error if null string .LF924 JSR ScanHex:PHP :\ Save flag CPX #&00:BEQ LF959 :\ X=0, nothing read in, 'Bad number' error PLP:RTS :\ Get flag back \ *PAGE - Set PAGE address \ ======================== .CmdPAGE JSR SkipSpaces:BEQ LF94A :\ No parameters, jump to use &0800 JSR LF924:BNE LF959 :\ Error if more parameters LDY &F7:LDX &F6:BNE LF94E :\ addr<>&xx00, error as must by 256-byte aligned CPY #&08:BCC LF94E :\ addr<&0800, error as too low CPY #&80:BCS LF94E :\ addr>&8000, error as too high .LF946 STY &F1:CLC:RTS :\ Store PAGE high byte .LF94A LDY #&08:BRA LF946 :\ Default to &0800 .LF94E BRK BRK:EQUS "Bad PAGE":BRK :\ Unusable PAGE value .LF959 BRK BRK:EQUS "Bad number":BRK :\ Bad hex .LF966 SEC:RTS :\ SEC=pass command to host \ *GO - Call machine code \ ======================= .CmdGO JSR SkipSpaces:BEQ LF984 :\ If no params, re-enter existing code JSR ScanHex :\ Scan hex parameter CPX #&00:BEQ LF966 :\ No hex parameter, pass to host :\ eg *GO HELLO CMP #&3B:BEQ LF97C :\ ';' CMP #&0D:BNE LF959 :\ More parameters, error .LF97C LDX &F6:LDY &F7 :\ Store parameter pointer :\ Enter code at XY .EnterCodeXY STX &F4:STY &F5 :\ Set memtop to entry address .LF984 LDA &EF:PHA:LDA &EE:PHA :\ Save current program JSR EnterCode PLA:STA &EE:STA &F4 :\ Restore current program and also set memtop PLA:STA &EF:STA &F5 CLC:RTS :\ CLC=command done \ Check if code to be entered has a ROM header .EnterCode LDA &F4:STA &EE :\ Current program starts at memtop LDA &F5:STA &EF LDX #&00:STX &03F5:STX &03FE :\ Set memtop and errptr are in block &00 LDY #&07:LDA (&F4),Y :\ Get copyright offset CLD:CLC:ADC &F4:STA &FD LDA #&00:ADC &F5:STA &FE :\ &FD/E=>copyright message \ Check for &00,"(C)" LDY #&00:LDA (&FD),Y:BNE LF9FC :\ Check for initial &00 INY:LDA (&FD),Y:CMP #&28:BNE LF9FC :\ Check for '(' INY:LDA (&FD),Y:CMP #&43:BNE LF9FC :\ Check for 'C' INY:LDA (&FD),Y:CMP #&29:BNE LF9FC :\ Check for ')' \ &00,"(C)" exists LDY #&06:LDA (&F4),Y :\ Get ROM type AND #&4D:CMP #&40:BCC LFA2A :\ b6=0, Not a language AND #&0D:BEQ LF9E6 :\ code=%x1xx00x0, enter 6502 code CMP #&01:BNE LFA0E :\ code<>%x1xx00x1, not 6502 code .LF9E6 \ romtype=%0000 - A=0 - 6502 BASIC \ romtype=%0001 - A=1 - Turbo6502 \ romtype=%0010 - A=0 - 6502 nonBASIC \ romtype=%0011 - A=1 - reserved PHA:LDY #&09 :\ Save entry value &00 or &01 .LF9E9 LDA (&F4),Y:BEQ LF9F3 :\ Print ROM title JSR OSWRCH:INY:BNE LF9E9 .LF9F3 JSR OSNEWL:JSR OSNEWL :\ Print two NLs PLA:BRA LF9FE :\ Get entry value back .LF9FC :\ No (C) string, enter as raw code LDA #&00 :\ Set flag=0 .LF9FE STA &F0 :\ Store flag at &F0 \ If flag=0, membot=&F0/1, memtop=&F4/5 \ If flag<>0, membot=0000, memtop=0000 LDY #&00:TYA .LFA03 STA &0300,Y:DEY:BNE LFA03 :\ All (zp),Y accesses to block &00 LDA #&01:JMP (&00F4) :\ Enter code with A=1 .LFA0E JSR ErrorInit BRK BRK:EQUS "I cannot run this code":BRK .LFA2A JSR ErrorInit BRK BRK:EQUS "This is not a language":BRK .ErrorInit LDA #ErrorHandler AND 255:STA BRKV :\ Claim BRKV LDA #ErrorHandler DIV 256:STA &0203 RTS \ *HELP - Display help \ ==================== .CmdHELP JSR SkipSpaces:BNE LFA5C :\ Exit if parameters JSR OSNEWL:JSR HelpBanner:\ Display startup banner .LFA5C SEC:RTS :\ Return, SEC to pass to host .HelpBanner JSR PrText EQUS "6502 Emulator OS 0.64 (19 Oct 1988)" EQUB 10:EQUB 13 NOP RTS .osBYTE :\ OSBYTE PHA CMP #&82:BEQ BYTE82 :\ Read memory high word CMP #&83:BEQ BYTE83 :\ Read bottom of memory CMP #&84:BEQ BYTE84 :\ Read top of memory CMP #&85:BEQ BYTE85 :\ Read top of memory for screen mode CMP #&8E:BEQ BYTE8E :\ Enter language CMP #&A3:BNE BYTEnn :\ Jump if not Application OSBYTE CPX #&FE:BCC BYTEnn :\ Jump if X<&FE \ OSBYTE &A3,&FE and OSBYTE &A3,FF - return unchanged PLA RTS .BYTEnn :\ Pass OSBYTE to host EQUB &13 :\ MOS_BYTE PLA:RTS :\ Return .BYTE82 :\ Read memory high word LDX #&00:LDY #&00 :\ High word=&0000 PLA:RTS .BYTE83 :\ Read bottom of memory PLA :\ Get A back LDX &F0:BEQ LFABC :\ If &F0=0, &F0/F1=>memory bottom LDA #&01 :\ Set A=&01 LDX #&00:LDY #&00 :\ Return memory bottom=&0000 RTS .LFABC LDX #&00:LDY &F1 :\ Get memory bottom from &F0/F1 RTS .BYTE84 :\ Read top of memory PLA :\ Get A back LDX &F0:BEQ LFACD :\ If &F0=0, &F4/5=>memory top LDA #&04 :\ Set A=&04 LDX #&00:LDY #&00 :\ Return memory top=&0000 RTS .LFACD LDX &F4:LDY &F5 :\ Get memory top from &F4/F5 RTS .BYTE85 :\ Read top of memory for screem LDX #&00:LDY #&80 :\ Return top of memory=&8000 PLA:RTS :\ Restore A and return .BYTE8E :\ Enter language JMP CmdBASIC :\ Jump to enter BASIC .osBGet EQUB &73 :\ Pass OSBGet to host RTS .osBPut EQUB &83 :\ Pass OSBPut to host RTS .osFILE EQUB &53 :\ Pass OSFILE to host RTS .osFIND EQUB &A3 :\ Pass OSFIND to host RTS .osGBPB EQUB &93 :\ Pass OSGBPB to host RTS .osRDCH EQUB &43 :\ Pass OSRDCH to host RTS .osWRCH EQUB &33 :\ Pass OSWRCH to host RTS .osWORD :\ OSWORD CMP #&05:BNE LFB0C :\ Jump if not Read I/O memory : \ OSWORD 5 - Read I/O memory \ Reads from Tube memory STX &F8:STY &F9 :\ &F8/9=>control block LDY #&00:STY &03F9 :\ Control block at (&F8),Y in block &00 LDA (&F8),Y:STA &FA INY LDA (&F8),Y:STA &FB :\ &FA/B=address to read LDX #&00:LDA (&FA,X) :\ Read from address LDY #&04:STA (&F8),Y :\ Store byte read in control block LDX &F8:LDY &F9 :\ Restore X, Y RTS .LFB0C EQUB &23 :\ Pass OSWORD to host RTS .osARGS :\ OSARGS CMP #&01:BNE LFB3C :\ Jump if not command line/PTR= CPY #&00:BNE LFB3C :\ Jump if not command line : \ OSARGS 1,0 - Read address of command line STY &03F3:DEY :\ String at (&F2),Y is in block &00 .LFB1A INY:LDA (&F2),Y :\ Get character from command line CMP #&20:BCC LFB26 :\ Control character found BNE LFB1A :\ Loop if not space JSR SkipSpaces :\ Skip any more spaces .LFB26 CLC:TYA:ADC &F2:STA &00,X :\ Add Y to base LDA &F3:ADC #&00:STA &01,X :\ Set returned address LDY #&FF:STY &02,X:STY &03,X :\ Set to &FFFFxxxx INY:LDA #&01 :\ Return Y=&00, A=&01 RTS .LFB3C EQUB &63 :\ Pass OSARGS to host RTS \ Print embedded string \ ===================== .PrText PLA:STA &FA:PLA:STA &FB :\ &FA/B=>embedded string LDY #&00:STY &03FB :\ String at (&FA),Y is in block &00 INY .LFB4A LDA (&FA),Y :\ Get character CMP #&EA:BEQ LFB56 :\ Exit if NOP JSR OSWRCH:INY:BNE LFB4A :\ Print char and loop for next .LFB56 TYA:CLC:ADC &FA TAX:LDA #&00:ADC &FB :\ Update return address PHA:TXA:PHA :\ Points after string .NullReturn RTS \ Print string at XY \ ------------------ .PrString STX &FA:STY &FB :\ Store XY in &FA/B LDY #&00:STY &03FB :\ String at (&FA),Y is in block &00 .LFB6C LDA (&FA),Y :\ Get a character CMP #&20:BCC LFB78 :\ Exit at control char JSR OSWRCH:INY:BNE LFB6C :\ Print character .LFB78 RTS .Unsupported BRK BRK:EQUS "Unsupported":BRK \ Default vectors .LFB87 EQUW Unsupported :\ &200 - USERV EQUW ErrorHandler :\ &202 - BRKV EQUW IRQ1Handler :\ &204 - IRQ1V EQUW Unsupported :\ &206 - IRQ2V 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 NullReturn :\ &222 - UPTV EQUW NullReturn :\ &224 - NETV EQUW Unsupported :\ &226 - VduV EQUW Unsupported :\ &228 - KEYV EQUW Unsupported :\ &22A - INSV EQUW Unsupported :\ &22C - RemV EQUW Unsupported :\ &22E - CNPV EQUW NullReturn :\ &230 - IND1V EQUW NullReturn :\ &232 - IND2V EQUW NullReturn :\ &234 - IND3V .osCLI :\ OSCLI STX &F2:STY &F3 :\ &F2/3=>command string LDY #&00:STY &03F3 :\ String at (&F2),Y is in block &00 .LFBC6 LDA (&F2),Y:STA LFC6A,Y :\ Copy command line to command buffer CMP #&0D:BEQ LFBD3 :\ Loop until INY:BNE LFBC6 :\ Loop for up to 256 characters .LFBD2 RTS :\ No found, exit .LFBD3 LDX #LFC6A AND 255 LDY #LFC6A DIV 256 :\ Point XY to command buffer STX &F2:STY &F3 :\ Point &F2/3 to command buffer LDX #&00:LDY #&FF .LFBDF JSR SkipSpaces1 :\ Move past and skip spaces CMP #ASC"*":BEQ LFBDF :\ Skip past '*'s CMP #&0D:BEQ LFBD2 :\ Null string, exit CMP #ASC"|":BEQ LFBD2 :\ *|, comment, exit CLC:TYA:ADC &F2:STA &F2 :\ Adjust &F2/3 to point to start of command BCC LFBF8:INC &F3 .LFBF8 LDY #&00:LDA (&F2),Y :\ Get first character CMP #ASC".":BEQ LFC45 :\ '*.', jump to pass to host .LFC00 TYA:PHA :\ Save command pointer JSR SkipSpaces :\ Skip any more spaces .LFC05 LDA LFF02,X:BMI LFC20 :\ Jump if at end of command table EOR (&F2),Y :\ Compare with command table AND #&DF:BNE LFC14 :\ Ignore case, jump if no match INX:INY:BRA LFC05 :\ Loop to check next character .LFC14 LDA (&F2),Y:INY :\ Get command character CMP #ASC".":BEQ LFC29 :\ Abbreviated, jump to execute .LFC1B PLA:TAY :\ Get command pointer back SEC:BRA LFC2B :\ Step to next entry .LFC20 ASL A:BMI LFC29 LDA (&F2),Y :\ Get next character CMP #ASC"A":BCS LFC1B :\ Still more letters, try next entry .LFC29 PLA:CLC :\ Drop command pointer .LFC2B DEX .LFC2C INX:LDA LFF02,X:BPL LFC2C :\ Find end of entry BCC LFC3C INX:LDA LFF02,X BNE LFC00:BEQ LFC45 .LFC3C ASL A:AND #&7F :\ Index into command table TAX:JSR LFC4B :\ Call command routine BCC LFC4A :\ If CLC, exit with call claimed .LFC45 LDX &F2:LDY &F3 :\ &F2/3=XY EQUB &03 :\ Pass OSCLI to host .LFC4A RTS .LFC4B LDA LFC5E+1,X:PHA :\ Stack address high byte LDA LFC5E+0,X:PHA :\ Stack address low byte RTS :\ Jump to routine .SkipSpaces1 INY .SkipSpaces LDA (&F2),Y:CMP #&20:BEQ SkipSpaces1 CMP #&0D:RTS \ Command addresses \ ----------------- .LFC5E EQUW CmdBASIC-1 :\ *BASIC EQUW CmdQUIT-1 :\ *QUIT EQUW CmdHELP-1 :\ *HELP EQUW CmdGO-1 :\ *GO EQUW CmdOS-1 :\ *OS EQUW CmdPAGE-1 :\ *PAGE \ OSCLI command buffer \ -------------------- .LFC6A EQUS STRING$(128,CHR$0) EQUS STRING$(128,CHR$0) .LFD6A BRK:BRK .LFD6C STZ &C0 AND #&00 CLC RTS \ This looks like a bit of BASIC code \ ----------------------------------- .LFD72 LDA &0B:STA &19 LDA &0C:STA &1A LDA &0A:STA &1B .LFD7E LDY &1B:INC &1B LDA (&19),Y CMP #&20:BEQ LFD7E CMP #&3D:BEQ LFDBA .LFD8C BRK EQUB &04:EQUS "Mistake" .LFD95 BRK EQUB &10:EQUS "Syntax error" .LFDA3 BRK EQUB &0D:EQUS "No ":EQUB &F2 .LFDA9 BRK EQUB &11:EQUS "Escape" BRK .LFDB2 JSR &C742 CMP #&3D:BNE LFD8C RTS .LFDBA JSR &D5AF:TXA LDY &1B:BRA LFDDC LDY &1B:BRA LFDD4 TSX:CPX #&FC:BCS LFDA3 LDA &01FF:CMP #&F2:BNE LFDA3 LDY &0A .LFDD4 DEY .LFDD5 INY:LDA (&0B),Y CMP #&20:BEQ LFDD5 .LFDDC CMP #&3A:BEQ LFDE8 CMP #&0D:BEQ LFDE8 CMP #&8B:BNE LFD95 .LFDE8 CLC:TYA:ADC &0B:STA &0B BCC LFDF2:INC &0C .LFDF2 LDY #&01:STY &0A BIT &FF:BMI LFDA9 .LFDFA RTS .LFDFB JSR &D41A LDA (&0B):CMP #&3A:BEQ LFDFA LDA &0C:CMP #&07:BEQ LFE2E LDY #&01:LDA (&0B),Y:BMI LFE2E LDX &20:BEQ LFE1E STA &2B:INY:LDA (&0B),Y:STA &2A JSR &D4BF .LFE1E LDA #&03:CLC:ADC &0B:STA &0B BCC LFE29:INC &0C .LFE29 LDY #&01:STY &0A .LFE2D RTS .LFE2E JMP &C7FB .LFE31 JMP &C905 .LFE34 JSR &D5A3:BEQ LFE31 BPL LFE3E:JSR &CF38 .LFE3E LDY &1B:STY &0A:LDA &2A ORA &2B:ORA &2C:ORA &2D:BEQ LFE63 CPX #&8C:BEQ LFE53 .LFE50 JMP &C880 .LFE53 INC &0A .LFE55 JSR &D392:BCC LFE50 JSR &F018:JSR &D43A JMP &EF05 .LFE63 LDY &0A .LFE65 LDA (&0B),Y:CMP #&0D:BEQ LFE74 INY:CMP #&8B:BNE LFE65 STY &0A:BEQ LFE55 .LFE74 JMP &C82D .LFE77 LDA &2A:CMP &21:LDA &2B SBC &22:BCS LFE2D LDA #&5B:JSR &F58A JSR &D898:LDA #&5D JSR &F58A: JMP &F584 .LFE91 JSR &F3EC:JSR &D6B7 TAY:JSR &CF52 JSR &F3D6:JSR &DCC4 LDA &2E:EOR &3B:BPL LFEBF ASL &2E:BRA LFEE1 .LFEAB STY &2D:PLA:STA &2C PLA:STA &2B PLA:STA &2A JSR &BA3A LDA &3B:EOR #&80:STA &3B .LFEBF LDA &3C:CMP &30:BNE LFEDD LDA &3D:CMP &31:BNE LFEDD LDA &3E:CMP &32:BNE LFEDD LDA &3F:CMP &33:BNE LFEDD LDA &40:SBC &34:BEQ LFEE3 .LFEDD ROR A:EOR &3B:ROL A .LFEE1 LDA #&FF .LFEE3 RTS .LFEE4 JMP &C905 .LFEE7 INC &1B:TXA:BEQ LFF2C BMI LFE91 LDA &2A:PHA LDA &2B:PHA LDA &2C:PHA LDA &2D:PHA JSR &D6B7:TAY:BMI LFF1C TRB &FF \ Command table .LFF02 EQUS "GO":EQUB &C3 EQUS "HELP":EQUB &82 EQUS "OS":EQUB &84 EQUS "PAGE":EQUB &C5 EQUS "QUIT":EQUB &81 EQUS "BASIC" .LFF1C EQUB &80:EQUB &00 EQUS STRING$(&FF2C-P%,CHR$0) .LFF2C EQUS STRING$(&FFB6-P%,CHR$0) .VECDEF :EQUB &36:EQUW LFB87 .LFFxx :JMP Unsupported .LFFxx :JMP Unsupported .LFFxx :JMP Unsupported .LFFxx :JMP Unsupported .LFFxx :JMP Unsupported .NVRDCH :JMP osRDCH .NVWRCH :JMP osWRCH .OSFIND :JMP (FINDV) .OSGBPB :JMP (GBPBV) .OSBPUT :JMP (BPutV) .OSBGET :JMP (BGetV) .OSARGS :JMP (ARGSV) .OSFILE :JMP (FILEV) .OSRDCH :JMP (RDCHV) .OSASCI :CMP #&0D:BNE OSWRCH .OSNEWL :LDA #&0A:JSR OSWRCH .OSPRCR :LDA #&0D .OSWRCH :JMP (WRCHV) .OSWORD :JMP (WORDV) .OSBYTE :JMP (BYTEV) .OS_CLI :JMP (CLIV) .NMIV :EQUW NMIHandler .RESETV :EQUW RESET .IRQV :EQUW InterruptHandler ]:NEXT