8-Bit Software Online Conversion
Trap Vectors - Listing
0MODE0
10REM Prints out A,X,Y for a vector
20DIMalia$(27)
30DIMtrap% 256
40:
50FORloop%=1TO27:READalia$(loop%):NEX
T
60REPEAT
70 INPUT"Trap which vector? "vector$
80 vector=TRUE
90 IFLEFT$(vector$,1)="&" THENvector=
EVAL(vector$)
100 IFLEFT$(vector$,1)<>"&" THENvector
=FNlookup(FNucase(vector$))
110UNTIL(vector>=&200)AND(vector<&236)
120:
130INPUT"Assemble at "loc$
140loc%=EVAL(loc$)
150:
160FORX=4TO7STEP3
170oswc=&FFEE
180O%=trap%:P%=loc%
190[OPTX
200.repoint
210SEI
220LDXvector:STXoldvec+1
230LDYvector+1:STYoldvec+2
240LDX#print MOD256:STXvector
250LDY#print DIV256:STYvector+1
260CLI:RTS
270.print
280PHP:PHA:LDA#ASC"[":JSRoswc:½Save st
atus & open brackets
290.pA
300LDA#ASC"A":JSRoswc:PLA:PHA:JSRhex:½
Print A
310.pX
320LDA#ASC"X":JSRoswc:TXA:JSRhex:½Prin
t X
330.pY
340LDA#ASC"Y":JSRoswc:TYA:JSRhex:½Prin
t Y
350.done
360LDA#ASC"]":JSRoswc:LDA#32:JSRoswc:P
LA:PLP:½Close brackets & return
370.oldvec
380JMP&9999:½Self modifies earlier
390.hex
400PHA:LSRA:LSRA:LSRA:LSRA:JSRconvert:
PLA:AND#15
410.convert
420SED:CMP#10:ADC#48:CLD:JMPoswc
430]
440NEXT
450OSCLI("SAVE OUTPUT "+STR$÷(trap%)+"
"+STR$÷(O%)+" "+STR$÷(loc%)+" "+STR$÷(l
oc%))
460END
470:
480DEFFNucase(string$)
490REM Alphabetics => upper case (ASCi
i values of a,z are 97,122)
500LOCALdata%,work$,byte%
510FORdata%=1TOLENstring$
520byte%=ASC(MID$(string$,data%,1))AND
&DF
530IFbyte%>ASC"Z" ORbyte%<ASC"A" THENw
ork$=work$+MID$(string$,data%,1) ELSEwor
k$=work$+CHR$byte%
540NEXT
550=work$
560:
570DEFFNlookup(string$)
580LOCALdata%:data%=TRUE
590FORloop%=1TO27
600IFstring$=alia$(loop%) THENdata%=&2
00+((loop%-1)*2):loop%=27
610NEXT
620=data%
630:
640DATA"USERV","BRKV","IRQ1V","IRQ2V"
650DATA"CLIV","BYTEV","WORDV","WRCHV"
660DATA"RDCHV","FILEV","ARGSV","BGETV"
670DATA"BPUTV","GBPBV","FINDV","FSCV"
680DATA"EVENTV","UPTV","NETV","VDUV"
690DATA"KEYV","INSV","REMV","CNPV"
700DATA"IND1V","IND2V","IND3V"