8-Bit Software Online Conversion
Trap Vector - Listing
0MODE7
10REM Prints out A,X,Y for a vector
20REM (C)1996 SPROW
30DIM trap% 256
40oswc=&FFEE
50INPUT"Assemble at "loc$
60INPUT"Trap which vector? &"vector$:
vector=EVAL("&"+vector$):IFvector<&200 T
HENGOTO60
70loc%=EVAL(loc$)
80FORX=4 TO 7 STEP3
90O%=trap%:P%=loc%
100[OPTX
110.repoint
120SEI
130LDXvector:STXoldvec+1
140LDYvector+1:STYoldvec+2
150LDX#print MOD256:STXvector
160LDY#print DIV256:STYvector+1
170CLI:RTS
180.print
190PHP:PHA:LDA#ASC("["):JSRoswc:PLA:PH
A:½Save status and print bracket
200.pA
210PHA:LDA#ASC("A"):JSRoswc:PLA:JSR he
x:½Print A
220.pX
230LDA#ASC("X"):JSRoswc:TXA:JSR hex:½P
rint X
240.pY
250LDA#ASC("Y"):JSRoswc:TYA:JSR hex:½P
rint Y
260.done
270LDA#ASC("]"):JSRoswc:LDA#32:JSRoswc
:PLA:PLP:½Close brackets & return
280.oldvec
290JMP&9999:½Self modifies when run
300.hex
310PHA:LSR A:LSR A:LSR A:LSR A:JSRconv
ert:PLA:AND #15:JSRconvert:RTS
320.convert
330SED:CMP #10:ADC #48:CLD:JMPoswc
340]
350NEXT
360OSCLI("SAVE OUTPUT "+STR$÷(trap%)+"
"+STR$÷(O%)+" "+STR$÷(loc%)+" "+STR$÷(l
oc%))