> TEST65io/src :  6502 BBC MOS Equates ( ==================== 2!ESCFLG =&FF : Escape flag <(FAULT =&FD : Last error message FOSARGS =&FFDA P.OSRDCH =&FFE0 : Wait for character input Z,OSASCI =&FFE3 : Output ASCII character d-OSNEWL =&FFE7 : Output newline sequence n!OSWRCR =&FFEC : Output x&OSWRCH =&FFEE : Output character 3OSWORD =&FFF1 : System info via control block /OSBYTE =&FFF4 : System info via registers %OS_CLI =&FFF7 : Execute command *BRKV =&0202 : Error handler vector "EVENTV =&0220 : Event vector : CODELOAD=&4000: mcode% &400  P=0 1:opt%=P*3+4 P%=CODELOAD:O%=mcode% [OPT opt% \ CODE HEADER \ ----------- .CODESTART JMP CODEENTRY BRK:BRK:BRK  EQUB &42 "EQUB COPYMSG-CODESTART , EQUB 0 6 .TITLE @!EQUS "65x02 I/O test program" J .COPYMSG T%EQUB 0:EQUS "(C)2014 J.G.Harston" ^ EQUB 0 hEQUD CODELOAD r: |.CODEENTRY PHP:PHA:TYA:PHA:TXA:PHA LDA &FFFB:BPL CHECK2 .BRK:EQUB 255:EQUS "Not running on I/O":BRK :  .CHECK2 %LDX #TITLE 255:LDY #TITLE 256 JSR PRSTRING:JSR OSNEWL:TSX  JSR PRTEXT:EQUS "A=&":EQUB 0 LDA &103,X:JSR PRHEX "JSR PRTEXT:EQUS " X=&":EQUB 0 LDA &101,X:JSR PRHEX "JSR PRTEXT:EQUS " Y=&":EQUB 0 LDA &102,X:JSR PRHEX $JSR PRTEXT:EQUS " S=&01":EQUB 0 TXA:CLC:ADC #4:JSR PRHEX "JSR PRTEXT:EQUS " P=&":EQUB 0 &LDA &104,X:JSR PRHEX 0: :-JSR PRTEXT:EQUB 13:EQUS "MEMBOT=&":EQUB 0 D"LDA #&83:JSR OSBYTE:JSR PR2HEX N'JSR PRTEXT:EQUS " MEMTOP=&":EQUB 0 X"LDA #&84:JSR OSBYTE:JSR PR2HEX b+JSR PRTEXT:EQUB 13:EQUS "CMD=> ":EQUB 0 l)LDA #&01:LDX #&A8:LDY #&00:JSR OSARGS v .CMDlp LDA (&A8),Y:JSR OSASCI INY:CMP #13:BNE CMDlp :  .EXIT PLA:PLA:PLA:PLA RTS :  .PRTEXT PLA:STA &F6:PLA:STA &F7 JSR PSTR3:JMP (&00F6)  .PRSTRING STX &F6:STY &F7  .PSTR2 LDY #0:LDA (&F6),Y  BEQ PSTR3:JSR OSASCI  .PSTR3  INC &F6:BNE PSTR4:INC &F7 * .PSTR4 4TAY:BNE PSTR2:RTS >: H .PR2HEX RTYA:JSR PRHEX:TXA \ .PRHEX fPHA:LSR A:LSR A:LSR A:LSR A pJSR PNYB:PLA z .PNYB ! #15:CMP #10:BCC PDIG:ADC #6  .PDIG ADC #"0":JMP OSWRCH : .PRSPACE:LDA #32:JMP OSWRCH  .PRKEY ;JSR PRTEXT:EQUB 13:EQUB 13:EQUS "Press a key...":EQUB 0 JSR OSRDCH:JMP OSWRCR : 7.TEST3:EQUS "This is using PRSTRING":EQUB 13:EQUB 0  .CMDHELP:EQUS "help":EQUB 13 .BRKSAVE:EQUW 0 : ] @"*SAVE TEST65io ";~mcode%;" ";~O%;" "~CODELOAD;" "~CODELOAD