home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_23_1988_Transactor_Publishing.d64
/
algo6510.3
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
1KB
|
59 lines
100 rem --------- program 3 -----------
110 rem
120 rem pal64 format source
130 rem
140 open 2,8,1,"0:output"
150 sys700
160 .opt o2
170 *=$c000
180 jmp begin
190 ;
200 ; table of mnemonics
210 ;
225 mnem .asc "adcandaslbccbcsbeqbitbmibnebplbrk"
230 .asc "bvcbvsclccldcliclvcmpcpxcpydecdex"
235 .asc "deyeorincinxinyjmpjsrldaldxldylsr"
240 .asc "noporaphaphpplaplprolrorrtirtssbc"
250 .asc "secsedseistastxstytaxtaytsxtxatxstya"
260 ;
270 ; resulting op-codes
280 ;
290 ops *=*+56
300 ;
310 ; tables for transformations
320 ;
330 table1 .byte 6,7,8,9,10,0,0,0,11,12,0,13,0
335 .byte 14,1,2,0,3,4,5,0,0,0,0,0,0
340 table2 .byte 10,11,12,13,14,0,0,15,16,0,0,17,18,1
345 .byte 2,3,0,4,5,6,0,7,0,8,9,0
350 table3 .byte 4,0,5,6,7,0,0,0,8,0,9,10,0
355 .byte 0,0,11,12,13,14,15,0,1,0,2,3,0
360 ;
370 ; execute the al(NULL)
380 ;
390 begin ldy #0: sty opsx
400 loop1 lda mnem+0,y: sec: sbc asca: tax: lda table1,x: beq error
410 sta temp ; (left-)*1
420 lda mnem+1,y: sec: sbc asca: tax: lda table2,x: beq error
430 lsr: lsr: lsr: lsr: clc: adc temp: sta temp ; +(mid-)*16
440 lda mnem+2,y: sec: sbc asca: tax: lda table3,x: beq error
450 lsr: lsr: clc: adc temp ; +(right-)*4
460 ldx opsx: sta ops,x: inx: stx opsx
470 iny: iny: iny: cpy #168: bne loop1
480 beq cont1
490 ;
500 ; error routine
510 ;
520 error = *
530 ;
540 ; print results/process code byte
550 ;
560 cont1 = *
570 ;
580 ; data areas
590 ;
600 opsx .byte 0
610 asca .byte "a"
620 temp .byte 0
630 .end