From: Oliver Schmidt Date: Sun, 19 Mar 2017 16:57:25 +0000 (+0100) Subject: Shortened test subdir names. X-Git-Tag: V2.16~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ff9b77b6cc96fbdfd06e7f4d6442d4b8c4dd9f86;p=cc65 Shortened test subdir names. --- diff --git a/test/Makefile b/test/Makefile index a02bd91fb..d0bee8ed8 100644 --- a/test/Makefile +++ b/test/Makefile @@ -25,16 +25,16 @@ all: dotests dotests: mostlyclean continue continue: - @$(MAKE) -C assembler all - @$(MAKE) -C disassembler all + @$(MAKE) -C asm all + @$(MAKE) -C dasm all @$(MAKE) -C val all @$(MAKE) -C ref all @$(MAKE) -C err all @$(MAKE) -C misc all mostlyclean: - @$(MAKE) -C assembler clean - @$(MAKE) -C disassembler clean + @$(MAKE) -C asm clean + @$(MAKE) -C dasm clean @$(MAKE) -C val clean @$(MAKE) -C ref clean @$(MAKE) -C err clean diff --git a/test/asm/4510-cpudetect.ref b/test/asm/4510-cpudetect.ref new file mode 100644 index 000000000..515557c85 Binary files /dev/null and b/test/asm/4510-cpudetect.ref differ diff --git a/test/asm/4510-opcodes.ref b/test/asm/4510-opcodes.ref new file mode 100644 index 000000000..b65b12e61 Binary files /dev/null and b/test/asm/4510-opcodes.ref differ diff --git a/test/asm/4510-opcodes.s b/test/asm/4510-opcodes.s new file mode 100644 index 000000000..3d6805674 --- /dev/null +++ b/test/asm/4510-opcodes.s @@ -0,0 +1,278 @@ +.setcpu "4510" + + brk + ora ($05,x) + cle + see + tsb $02 + ora $02 + asl $02 + rmb0 $02 + php + ora #$01 + asl + tsy + tsb $1234 + ora $1234 + asl $1234 + bbr0 $02,*+$34 + + bpl *+$32 + ora ($06),y + ora ($07),z + lbpl *+$3133 ; bpl *+$3133 + trb $02 + ora $03,x + asl $03,x + rmb1 $02 + clc + ora $1456,y + inc + inz + trb $1234 + ora $1345,x + asl $1345,x + bbr1 $02,*+$34 + + jsr $1234 + and ($05,x) + jsr ($2345) + jsr ($2456,x) + bit $02 + and $02 + rol $02 + rmb2 $02 + plp + and #$01 + rol + tys + bit $1234 + and $1234 + rol $1234 + bbr2 $02,*+$34 + + bmi *+$32 + and ($06),y + and ($07),z + lbmi *+$3133 ; bmi *+$3133 + bit $03,x + and $03,x + rol $03,x + rmb3 $02 + sec + and $1456,y + dec + dez + bit $1345,x + and $1345,x + rol $1345,x + bbr3 $02,*+$34 + + rti + eor ($05,x) + neg + asr + asr $02 + eor $02 + lsr $02 + rmb4 $02 + pha + eor #$01 + lsr + taz + jmp $1234 + eor $1234 + lsr $1234 + bbr4 $02,*+$34 + + bvc *+$32 + eor ($06),y + eor ($07),z + lbvc *+$3133 ; bvc *+$3133 + asr $03,x + eor $03,x + lsr $03,x + rmb5 $02 + cli + eor $1456,y + phy + tab + map + eor $1345,x + lsr $1345,x + bbr5 $02,*+$34 + + rts + adc ($05,x) + rtn #$09 + bsr *+$3133 + stz $02 + adc $02 + ror $02 + rmb6 $02 + pla + adc #$01 + ror + tza + jmp ($2345) + adc $1234 + ror $1234 + bbr6 $02,*+$34 + + bvs *+$32 + adc ($06),y + adc ($07),z + lbvs *+$3133 ; bvs *+$3133 + stz $03,x + adc $03,x + ror $03,x + rmb7 $02 + sei + adc $1456,y + ply + tba + jmp ($2456,x) + adc $1345,x + ror $1345,x + bbr7 $02,*+$34 + + bra *+$32 + sta ($05,x) + sta ($0f,s),y + sta ($0f,sp),y + lbra *+$3133 ; bra *+$3133 + sty $02 + sta $02 + stx $02 + smb0 $02 + dey + bit #$01 + txa + sty $1345,x + sty $1234 + sta $1234 + stx $1234 + bbs0 $02,*+$34 + + bcc *+$32 + sta ($06),y + sta ($07),z + lbcc *+$3133 ; bcc *+$3133 + sty $03,x + sta $03,x + stx $04,y + smb1 $02 + tya + sta $1456,y + txs + stx $1456,y + stz $1234 + sta $1345,x + stz $1345,x + bbs1 $02,*+$34 + + ldy #$01 + lda ($05,x) + ldx #$01 + ldz #$01 + ldy $02 + lda $02 + ldx $02 + smb2 $02 + tay + lda #$01 + tax + ldz $1234 + ldy $1234 + lda $1234 + ldx $1234 + bbs2 $02,*+$34 + + bcs *+$32 + lda ($06),y + lda ($07),z + lbcs *+$3133 ; bcs *+$3133 + ldy $03,x + lda $03,x + ldx $04,y + smb3 $02 + clv + lda $1456,y + tsx + ldz $1345,x + ldy $1345,x + lda $1345,x + ldx $1456,y + bbs3 $02,*+$34 + + cpy #$01 + cmp ($05,x) + cpz #$01 + dew $02 + cpy $02 + cmp $02 + dec $02 + smb4 $02 + iny + cmp #$01 + dex + asw $1234 + cpy $1234 + cmp $1234 + dec $1234 + bbs4 $02,*+$34 + + bne *+$32 + cmp ($06),y + cmp ($07),z + lbne *+$3133 ; bne *+$3133 + cpz $02 + cmp $03,x + dec $03,x + smb5 $02 + cld + cmp $1456,y + phx + phz + cpz $1234 + cmp $1345,x + dec $1345,x + bbs5 $02,*+$34 + + cpx #$01 + sbc ($05,x) + lda ($0f,s),y + lda ($0f,sp),y + inw $02 + cpx $02 + sbc $02 + inc $02 + smb6 $02 + inx + sbc #$01 + eom + nop + row $1234 + cpx $1234 + sbc $1234 + inc $1234 + bbs6 $02,*+$34 + + beq *+$32 + sbc ($06),y + sbc ($07),z + lbeq *+$3133 ; beq *+$3133 + phd #$089a + phw #$089a + sbc $03,x + inc $03,x + smb7 $02 + sed + sbc $1456,y + plx + plz + phd $1234 + phw $1234 + sbc $1345,x + inc $1345,x + bbs7 $02,*+$34 diff --git a/test/asm/6502-cpudetect.ref b/test/asm/6502-cpudetect.ref new file mode 100644 index 000000000..9b0aeb1f0 Binary files /dev/null and b/test/asm/6502-cpudetect.ref differ diff --git a/test/asm/6502-opcodes.ref b/test/asm/6502-opcodes.ref new file mode 100644 index 000000000..c12fa8fd6 Binary files /dev/null and b/test/asm/6502-opcodes.ref differ diff --git a/test/asm/6502-opcodes.s b/test/asm/6502-opcodes.s new file mode 100644 index 000000000..5cb94c29f --- /dev/null +++ b/test/asm/6502-opcodes.s @@ -0,0 +1,257 @@ +.setcpu "6502" + + brk + ora ($12,x) + .byte $02 + .byte $03 + .byte $04 + ora $12 + asl $12 + .byte $07 + php + ora #$12 + asl a + .byte $0B + .byte $0C + ora $3456 + asl $3456 + .byte $0F + bpl *+122 + ora ($12),y + .byte $12 + .byte $13 + .byte $14 + ora $12,x + asl $12,x + .byte $17 + clc + ora $3456,y + .byte $1A + .byte $1B + .byte $1C + ora $3456,x + asl $3456,x + .byte $1F + jsr $3456 + and ($12,x) + .byte $22 + .byte $23 + bit $12 + and $12 + rol $12 + .byte $27 + plp + and #$12 + rol a + .byte $2B + bit $3456 + and $3456 + rol $3456 + .byte $2F + bmi *+122 + and ($12),y + .byte $32 + .byte $33 + .byte $34 + and $12,x + rol $12,x + .byte $37 + sec + and $3456,y + .byte $3A + .byte $3B + .byte $3C + and $3456,x + rol $3456,x + .byte $3F + rti + eor ($12,x) + .byte $42 + .byte $43 + .byte $44 + eor $12 + lsr $12 + .byte $47 + pha + eor #$12 + lsr a + .byte $4B + jmp $3456 + eor $3456 + lsr $3456 + .byte $4F + bvc *+122 + eor ($12),y + .byte $52 + .byte $53 + .byte $54 + eor $12,x + lsr $12,x + .byte $57 + cli + eor $3456,y + .byte $5A + .byte $5B + .byte $5C + eor $3456,x + lsr $3456,x + .byte $5F + rts + adc ($12,x) + .byte $62 + .byte $63 + .byte $64 + adc $12 + ror $12 + .byte $67 + pla + adc #$12 + ror a + .byte $6B + jmp ($3456) + adc $3456 + ror $3456 + .byte $6F + bvs *+122 + adc ($12),y + .byte $72 + .byte $73 + .byte $74 + adc $12,x + ror $12,x + .byte $77 + sei + adc $3456,y + .byte $7A + .byte $7B + .byte $7C + adc $3456,x + ror $3456,x + .byte $7F + .byte $80 + sta ($12,x) + .byte $82 + .byte $83 + sty $12 + sta $12 + stx $12 + .byte $87 + dey + .byte $89 + txa + .byte $8B + sty $3456 + sta $3456 + stx $3456 + .byte $8F + bcc *+122 + sta ($12),y + .byte $92 + .byte $93 + sty $12,x + sta $12,x + stx $12,y + .byte $97 + tya + sta $3456,y + txs + .byte $9B + .byte $9C + sta $3456,x + .byte $9E + .byte $9F + ldy #$12 + lda ($12,x) + ldx #$12 + .byte $A3 + ldy $12 + lda $12 + ldx $12 + .byte $A7 + tay + lda #$12 + tax + .byte $AB + ldy $3456 + lda $3456 + ldx $3456 + .byte $AF + bcs *+122 + lda ($12),y + .byte $B2 + .byte $B3 + ldy $12,x + lda $12,x + ldx $12,y + .byte $B7 + clv + lda $3456,y + tsx + .byte $BB + ldy $3456,x + lda $3456,x + ldx $3456,y + .byte $BF + cpy #$12 + cmp ($12,x) + .byte $C2 + .byte $C3 + cpy $12 + cmp $12 + dec $12 + .byte $C7 + iny + cmp #$12 + dex + .byte $CB + cpy $3456 + cmp $3456 + dec $3456 + .byte $CF + bne *+122 + cmp ($12),y + .byte $D2 + .byte $D3 + .byte $D4 + cmp $12,x + dec $12,x + .byte $D7 + cld + cmp $3456,y + .byte $DA + .byte $DB + .byte $DC + cmp $3456,x + dec $3456,x + .byte $DF + cpx #$12 + sbc ($12,x) + .byte $E2 + .byte $E3 + cpx $12 + sbc $12 + inc $12 + .byte $E7 + inx + sbc #$12 + .byte $EB + cpx $3456 + sbc $3456 + inc $3456 + .byte $EF + beq *+122 + sbc ($12),y + .byte $F2 + .byte $F3 + .byte $F4 + sbc $12,x + inc $12,x + .byte $F7 + sed + sbc $3456,y + .byte $FA + .byte $FB + .byte $FC + sbc $3456,x + inc $3456,x + .byte $FF diff --git a/test/asm/6502x-cpudetect.ref b/test/asm/6502x-cpudetect.ref new file mode 100644 index 000000000..3434ecbea Binary files /dev/null and b/test/asm/6502x-cpudetect.ref differ diff --git a/test/asm/6502x-opcodes.ref b/test/asm/6502x-opcodes.ref new file mode 100644 index 000000000..f942bec76 Binary files /dev/null and b/test/asm/6502x-opcodes.ref differ diff --git a/test/asm/6502x-opcodes.s b/test/asm/6502x-opcodes.s new file mode 100644 index 000000000..5f21aeb9f --- /dev/null +++ b/test/asm/6502x-opcodes.s @@ -0,0 +1,258 @@ +.setcpu "6502X" + + brk + ora ($12,x) + jam + slo ($12,x) + nop $12 + ora $12 + asl $12 + slo $12 + php + ora #$12 + asl a + anc #$12 + nop $3456 + ora $3456 + asl $3456 + slo $3456 + bpl *+122 + ora ($12),y + .byte $12 ; jam + slo ($12),y + nop $12,x + ora $12,x + asl $12,x + slo $12,x + clc + ora $3456,y + .byte $1a ; nop + slo $3456,y + nop $3456,x + ora $3456,x + asl $3456,x + slo $3456,x + jsr $3456 + and ($12,x) + .byte $22 ; jam + rla ($12,x) + bit $12 + and $12 + rol $12 + rla $12 + plp + and #$12 + rol a + .byte $2b ; anc #$12 + bit $3456 + and $3456 + rol $3456 + rla $3456 + bmi *+122 + and ($12),y + .byte $32 ; jam + rla ($12),y + .byte $34,$12 ; nop $12,x + and $12,x + rol $12,x + rla $12,x + sec + and $3456,y + .byte $3a ; nop + rla $3456,y + .byte $3c,$56,$34 ; nop $3456,x + and $3456,x + rol $3456,x + rla $3456,x + rti + eor ($12,x) + .byte $42 ; jam + sre ($12,x) + .byte $44,$12 ; nop $12 + eor $12 + lsr $12 + sre $12 + pha + eor #$12 + lsr a + alr #$12 + jmp $3456 + eor $3456 + lsr $3456 + sre $3456 + bvc *+122 + eor ($12),y + .byte $52 ; jam + sre ($12),y + .byte $54,$12 ; nop $12,x + eor $12,x + lsr $12,x + sre $12,x + cli + eor $3456,y + .byte $5a ; nop + sre $3456,y + nop $3456,x + eor $3456,x + lsr $3456,x + sre $3456,x + rts + adc ($12,x) + .byte $62 ; jam + rra ($12,x) + .byte $64,$12 ; nop $12 + adc $12 + ror $12 + rra $12 + pla + adc #$12 + ror a + arr #$12 + jmp ($3456) + adc $3456 + ror $3456 + rra $3456 + bvs *+122 + adc ($12),y + .byte $72 ; jam + rra ($12),y + .byte $74,$12 ; nop $12,x + adc $12,x + ror $12,x + rra $12,x + sei + adc $3456,y + .byte $7a ; nop + rra $3456,y + .byte $7c,$56,$34 ; nop $3456,x + adc $3456,x + ror $3456,x + rra $3456,x + nop #$12 + sta ($12,x) + .byte $82,$12 ; nop #$12 + sax ($12,x) + sty $12 + sta $12 + stx $12 + sax $12 + dey + .byte $89,$12 ; nop #$12 + txa + .byte $8b,$12 ; xaa #$12 + sty $3456 + sta $3456 + stx $3456 + sax $3456 + bcc *+122 + sta ($12),y + .byte $92 ; jam + .byte $93,$12 ; ahx ($12),y + sty $12,x + sta $12,x + stx $12,y + sax $12,y + tya + sta $3456,y + txs + tas $3456,y + shy $3456,x + sta $3456,x + shx $3456,y + .byte $9f,$56,$34 ; ahx $3456,y + ldy #$12 + lda ($12,x) + ldx #$12 + lax ($12,x) + ldy $12 + lda $12 + ldx $12 + lax $12 + tay + lda #$12 + tax + lax #$12 + ldy $3456 + lda $3456 + ldx $3456 + lax $3456 + bcs *+122 + lda ($12),y + .byte $b2 ; jam + lax ($12),y + ldy $12,x + lda $12,x + ldx $12,y + lax $12,y + clv + lda $3456,y + tsx + las $3456,y + ldy $3456,x + lda $3456,x + ldx $3456,y + lax $3456,y + cpy #$12 + cmp ($12,x) + .byte $c2,$12 ; nop #$12 + dcp ($12,x) + cpy $12 + cmp $12 + dec $12 + dcp $12 + iny + cmp #$12 + dex + axs #$12 + cpy $3456 + cmp $3456 + dec $3456 + dcp $3456 + bne *+122 + cmp ($12),y + .byte $d2 ; jam + dcp ($12),y + .byte $d4,$12 ; nop $12,x + cmp $12,x + dec $12,x + dcp $12,x + cld + cmp $3456,y + .byte $da ; nop + dcp $3456,y + .byte $dc,$56,$34 ; nop $3456,x + cmp $3456,x + dec $3456,x + dcp $3456,x + cpx #$12 + sbc ($12,x) + .byte $e2,$12 ; nop #$12 + isc ($12,x) + cpx $12 + sbc $12 + inc $12 + isc $12 + inx + sbc #$12 + nop + .byte $eb ; nop + cpx $3456 + sbc $3456 + inc $3456 + isc $3456 + beq *+122 + sbc ($12),y + .byte $f2 ; jam + isc ($12),y + .byte $f4,$12 ; nop $12,x + sbc $12,x + inc $12,x + isc $12,x + sed + sbc $3456,y + .byte $fa ; nop + isc $3456,y + .byte $fc,$56,$34 ; nop $3456,x + sbc $3456,x + inc $3456,x + isc $3456,x diff --git a/test/asm/65816-cpudetect.ref b/test/asm/65816-cpudetect.ref new file mode 100644 index 000000000..4f6e767b0 Binary files /dev/null and b/test/asm/65816-cpudetect.ref differ diff --git a/test/asm/65c02-cpudetect.ref b/test/asm/65c02-cpudetect.ref new file mode 100644 index 000000000..9f790d5ff Binary files /dev/null and b/test/asm/65c02-cpudetect.ref differ diff --git a/test/asm/65c02-opcodes.ref b/test/asm/65c02-opcodes.ref new file mode 100644 index 000000000..2d44045cb Binary files /dev/null and b/test/asm/65c02-opcodes.ref differ diff --git a/test/asm/65c02-opcodes.s b/test/asm/65c02-opcodes.s new file mode 100644 index 000000000..09c3f04f2 --- /dev/null +++ b/test/asm/65c02-opcodes.s @@ -0,0 +1,258 @@ +.setcpu "65C02" + + brk + ora ($12,x) + .byte $02 + .byte $03 + tsb $12 + ora $12 + asl $12 + rmb0 $12 + php + ora #$12 + asl a + .byte $0B + tsb $3456 + ora $3456 + asl $3456 + bbr0 $12,*+122 + bpl *+122 + ora ($12),y + ora ($12) + .byte $13 + trb $12 + ora $12,x + asl $12,x + rmb1 $12 + clc + ora $3456,y + inc a + .byte $1B + trb $3456 + ora $3456,x + asl $3456,x + bbr1 $12,*+122 + jsr $3456 + and ($12,x) + .byte $22 + .byte $23 + bit $12 + and $12 + rol $12 + rmb2 $12 + plp + and #$12 + rol a + .byte $2B + bit $3456 + and $3456 + rol $3456 + bbr2 $12,*+122 + bmi *+122 + and ($12),y + and ($12) + .byte $33 + bit $12,x + and $12,x + rol $12,x + rmb3 $12 + sec + and $3456,y + dec a + .byte $3B + bit $3456,x + and $3456,x + rol $3456,x + bbr3 $12,*+122 + rti + eor ($12,x) + .byte $42 + .byte $43 + .byte $44 + eor $12 + lsr $12 + rmb4 $12 + pha + eor #$12 + lsr a + .byte $4B + jmp $3456 + eor $3456 + lsr $3456 + bbr4 $12,*+122 + bvc *+122 + eor ($12),y + eor ($12) + .byte $53 + .byte $54 + eor $12,x + lsr $12,x + rmb5 $12 + cli + eor $3456,y + phy + .byte $5B + .byte $5C + eor $3456,x + lsr $3456,x + bbr5 $12,*+122 + rts + adc ($12,x) + .byte $62 + .byte $63 + stz $12 + adc $12 + ror $12 + rmb6 $12 + pla + adc #$12 + ror a + .byte $6B + jmp ($3456) + adc $3456 + ror $3456 + bbr6 $12,*+122 + bvs *+122 + adc ($12),y + adc ($12) + .byte $73 + stz $12,x + adc $12,x + ror $12,x + rmb7 $12 + sei + adc $3456,y + ply + .byte $7B + jmp ($3456,x) + adc $3456,x + ror $3456,x + bbr7 $12,*+122 + bra *+122 + sta ($12,x) + .byte $82 + .byte $83 + sty $12 + sta $12 + stx $12 + smb0 $12 + dey + bit #$12 + txa + .byte $8B + sty $3456 + sta $3456 + stx $3456 + bbs0 $12,*+122 + bcc *+122 + sta ($12),y + sta ($12) + .byte $93 + sty $12,x + sta $12,x + stx $12,y + smb1 $12 + tya + sta $3456,y + txs + .byte $9B + stz $3456 + sta $3456,x + stz $3456,x + bbs1 $12,*+122 + ldy #$12 + lda ($12,x) + ldx #$12 + .byte $A3 + ldy $12 + lda $12 + ldx $12 + smb2 $12 + tay + lda #$12 + tax + .byte $AB + ldy $3456 + lda $3456 + ldx $3456 + bbs2 $12,*+122 + bcs *+122 + lda ($12),y + lda ($12) + .byte $B3 + ldy $12,x + lda $12,x + ldx $12,y + smb3 $12 + clv + lda $3456,y + tsx + .byte $BB + ldy $3456,x + lda $3456,x + ldx $3456,y + bbs3 $12,*+122 + cpy #$12 + cmp ($12,x) + .byte $C2 + .byte $C3 + cpy $12 + cmp $12 + dec $12 + smb4 $12 + iny + cmp #$12 + dex + .byte $CB + cpy $3456 + cmp $3456 + dec $3456 + bbs4 $12,*+122 + bne *+122 + cmp ($12),y + cmp ($12) + .byte $D3 + .byte $D4 + cmp $12,x + dec $12,x + smb5 $12 + cld + cmp $3456,y + phx + .byte $DB + .byte $DC + cmp $3456,x + dec $3456,x + bbs5 $12,*+122 + cpx #$12 + sbc ($12,x) + .byte $E2 + .byte $E3 + cpx $12 + sbc $12 + inc $12 + smb6 $12 + inx + sbc #$12 + nop + .byte $EB + cpx $3456 + sbc $3456 + inc $3456 + bbs6 $12,*+122 + beq *+122 + sbc ($12),y + sbc ($12) + .byte $F3 + .byte $F4 + sbc $12,x + inc $12,x + smb7 $12 + sed + sbc $3456,y + plx + .byte $FB + .byte $FC + sbc $3456,x + inc $3456,x + bbs7 $12,*+122 diff --git a/test/asm/65sc02-cpudetect.ref b/test/asm/65sc02-cpudetect.ref new file mode 100644 index 000000000..4e11bd708 Binary files /dev/null and b/test/asm/65sc02-cpudetect.ref differ diff --git a/test/asm/65sc02-opcodes.ref b/test/asm/65sc02-opcodes.ref new file mode 100644 index 000000000..d22fe6688 Binary files /dev/null and b/test/asm/65sc02-opcodes.ref differ diff --git a/test/asm/65sc02-opcodes.s b/test/asm/65sc02-opcodes.s new file mode 100644 index 000000000..aa539913a --- /dev/null +++ b/test/asm/65sc02-opcodes.s @@ -0,0 +1,258 @@ +.setcpu "65SC02" + + brk + ora ($12,x) + .byte $02 + .byte $03 + tsb $12 + ora $12 + asl $12 + .byte $07 + php + ora #$12 + asl a + .byte $0B + tsb $3456 + ora $3456 + asl $3456 + .byte $0F + bpl *+122 + ora ($12),y + ora ($12) + .byte $13 + trb $12 + ora $12,x + asl $12,x + .byte $17 + clc + ora $3456,y + inc a + .byte $1B + trb $3456 + ora $3456,x + asl $3456,x + .byte $1F + jsr $3456 + and ($12,x) + .byte $22 + .byte $23 + bit $12 + and $12 + rol $12 + .byte $27 + plp + and #$12 + rol a + .byte $2B + bit $3456 + and $3456 + rol $3456 + .byte $2F + bmi *+122 + and ($12),y + and ($12) + .byte $33 + bit $12,x + and $12,x + rol $12,x + .byte $37 + sec + and $3456,y + dec a + .byte $3B + bit $3456,x + and $3456,x + rol $3456,x + .byte $3F + rti + eor ($12,x) + .byte $42 + .byte $43 + .byte $44 + eor $12 + lsr $12 + .byte $47 + pha + eor #$12 + lsr a + .byte $4B + jmp $3456 + eor $3456 + lsr $3456 + .byte $4F + bvc *+122 + eor ($12),y + eor ($12) + .byte $53 + .byte $54 + eor $12,x + lsr $12,x + .byte $57 + cli + eor $3456,y + phy + .byte $5B + .byte $5C + eor $3456,x + lsr $3456,x + .byte $5F + rts + adc ($12,x) + .byte $62 + .byte $63 + stz $12 + adc $12 + ror $12 + .byte $67 + pla + adc #$12 + ror a + .byte $6B + jmp ($3456) + adc $3456 + ror $3456 + .byte $6F + bvs *+122 + adc ($12),y + adc ($12) + .byte $73 + stz $12,x + adc $12,x + ror $12,x + .byte $77 + sei + adc $3456,y + ply + .byte $7B + jmp ($3456,x) + adc $3456,x + ror $3456,x + .byte $7F + bra *+122 + sta ($12,x) + .byte $82 + .byte $83 + sty $12 + sta $12 + stx $12 + .byte $87 + dey + bit #$12 + txa + .byte $8B + sty $3456 + sta $3456 + stx $3456 + .byte $8F + bcc *+122 + sta ($12),y + sta ($12) + .byte $93 + sty $12,x + sta $12,x + stx $12,y + .byte $97 + tya + sta $3456,y + txs + .byte $9B + stz $3456 + sta $3456,x + stz $3456,x + .byte $9F + ldy #$12 + lda ($12,x) + ldx #$12 + .byte $A3 + ldy $12 + lda $12 + ldx $12 + .byte $A7 + tay + lda #$12 + tax + .byte $AB + ldy $3456 + lda $3456 + ldx $3456 + .byte $AF + bcs *+122 + lda ($12),y + lda ($12) + .byte $B3 + ldy $12,x + lda $12,x + ldx $12,y + .byte $B7 + clv + lda $3456,y + tsx + .byte $BB + ldy $3456,x + lda $3456,x + ldx $3456,y + .byte $BF + cpy #$12 + cmp ($12,x) + .byte $C2 + .byte $C3 + cpy $12 + cmp $12 + dec $12 + .byte $C7 + iny + cmp #$12 + dex + .byte $CB + cpy $3456 + cmp $3456 + dec $3456 + .byte $CF + bne *+122 + cmp ($12),y + cmp ($12) + .byte $D3 + .byte $D4 + cmp $12,x + dec $12,x + .byte $D7 + cld + cmp $3456,y + phx + .byte $DB + .byte $DC + cmp $3456,x + dec $3456,x + .byte $DF + cpx #$12 + sbc ($12,x) + .byte $E2 + .byte $E3 + cpx $12 + sbc $12 + inc $12 + .byte $E7 + inx + sbc #$12 + nop + .byte $EB + cpx $3456 + sbc $3456 + inc $3456 + .byte $EF + beq *+122 + sbc ($12),y + sbc ($12) + .byte $F3 + .byte $F4 + sbc $12,x + inc $12,x + .byte $F7 + sed + sbc $3456,y + plx + .byte $FB + .byte $FC + sbc $3456,x + inc $3456,x + .byte $FF diff --git a/test/asm/Makefile b/test/asm/Makefile new file mode 100644 index 000000000..fb840446c --- /dev/null +++ b/test/asm/Makefile @@ -0,0 +1,68 @@ +# Makefile for the assembler regression tests + +ifneq ($(shell echo),) + CMD_EXE = 1 +endif + +ifdef CMD_EXE + EXE = .exe + MKDIR = mkdir $(subst /,\,$1) + RMDIR = -rmdir /s /q $(subst /,\,$1) + DEL = del /f $(subst /,\,$1) +else + EXE = + MKDIR = mkdir -p $1 + RMDIR = $(RM) -r $1 + DEL = $(RM) $1 +endif + +CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65) + +WORKDIR = ../../testwrk/asm + +DIFF = $(WORKDIR)/bdiff$(EXE) + +CC = gcc +CFLAGS = -O2 + +.PHONY: all clean + +OPCODE_REFS := $(wildcard *-opcodes.ref) +OPCODE_CPUS = $(foreach ref,$(OPCODE_REFS),$(ref:%-opcodes.ref=%)) +OPCODE_BINS = $(foreach cpu,$(OPCODE_CPUS),$(WORKDIR)/$(cpu)-opcodes.bin) + +CPUDETECT_REFS := $(wildcard *-cpudetect.ref) +CPUDETECT_CPUS = $(foreach ref,$(CPUDETECT_REFS),$(ref:%-cpudetect.ref=%)) +CPUDETECT_BINS = $(foreach cpu,$(CPUDETECT_CPUS),$(WORKDIR)/$(cpu)-cpudetect.bin) + +all: $(OPCODE_BINS) $(CPUDETECT_BINS) + +$(WORKDIR): + $(call MKDIR,$(WORKDIR)) + +$(DIFF): ../bdiff.c | $(WORKDIR) + $(CC) $(CFLAGS) -o $@ $< + +define OPCODE_template + +$(WORKDIR)/$1-opcodes.bin: $1-opcodes.s $(DIFF) + $(CL65) --cpu $1 -t none -l $(WORKDIR)/$1-opcodes.lst -o $$@ $$< + $(DIFF) $$@ $1-opcodes.ref + +endef # OPCODE_template + +$(foreach cpu,$(OPCODE_CPUS),$(eval $(call OPCODE_template,$(cpu)))) + +define CPUDETECT_template + +$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $(DIFF) + $(CL65) --cpu $1 -t none -l $(WORKDIR)/$1-cpudetect.lst -o $$@ $$< + $(DIFF) $$@ $1-cpudetect.ref + +endef # CPUDETECT_template + +$(foreach cpu,$(CPUDETECT_CPUS),$(eval $(call CPUDETECT_template,$(cpu)))) + +clean: + @$(call RMDIR,$(WORKDIR)) + @$(call DEL,$(OPCODE_REFS:.ref=.o) cpudetect.o) diff --git a/test/asm/README b/test/asm/README new file mode 100644 index 000000000..a2b1e9a41 --- /dev/null +++ b/test/asm/README @@ -0,0 +1,48 @@ + +Assembler Testcases +=================== + +Opcode Tests: +------------- + +These testcases are inspired by the ones now removed from test/assembler. +The main purpose is to have each possible opcode generated at least once, +either by an assembly instruction or a ".byte"-placeholder. Typically +generated by disassembling a binary dump that contains data in the form +of the pattern that each opcode is stated once in order followed by easy +to recognise: + +00 00 EA 00 +01 00 EA 00 +02 00 EA 00 +[...] +fe 00 EA 00 +ff 00 EA 00 + +The disassembly is then put in a better readable form by replacing the +leftover dummy opcode parameters with something more recognizable. + +The testcases for 6502, 6502x, 65sc02, 65c02, 4510, and huc6280 have been +put together by Sven Oliver ("SvOlli") Moll, as well as a template for the +m740 instructions set. + +Still to do is to find a way to implement an opcode testcase for the 65816 +processor, since it's capable of executing instructions with an 8-bit and +a 16-bit operator alike, only distinguished by one processor flag. + + +CPU detect Tests +---------------- + +These tests all assemble the same file "cpudetect.s" which contains several +conditionals for several CPUs, only using every option known to the "--cpu" +commandline switch of ca65/cl65. + + +Reference (".ref") Files +------------------------ + +A hint on creating these files: when running the test, it will fail due to +the missing ".ref" file. Review the output of the ".lst" very pedantic, then +copy the ".bin" to the ".ref" file. + diff --git a/test/asm/cpudetect.s b/test/asm/cpudetect.s new file mode 100644 index 000000000..adad7c1dc --- /dev/null +++ b/test/asm/cpudetect.s @@ -0,0 +1,66 @@ + +.macpack cpu + +; step 1: try to assemble an instruction that's exclusive to this set +; (when possible) + +.ifp02 + lda #$ea +.endif + +.ifpsc02 + jmp ($1234,x) +.endif + +.ifpc02 + rmb0 $12 +.endif + +.ifp816 + xba +.endif + +.ifp4510 + taz +.endif + + +; step 2: check for bitwise compatibility of instructions sets +; (made verbose for better reading with hexdump/hd(1)) + +.if (.cpu .bitand CPU_ISET_NONE) + .byte 0,"CPU_ISET_NONE" +.endif + +.if (.cpu .bitand CPU_ISET_6502) + .byte 0,"CPU_ISET_6502" +.endif + +.if (.cpu .bitand CPU_ISET_6502X) + .byte 0,"CPU_ISET_6502X" +.endif + +.if (.cpu .bitand CPU_ISET_65SC02) + .byte 0,"CPU_ISET_65SC02" +.endif + +.if (.cpu .bitand CPU_ISET_65C02) + .byte 0,"CPU_ISET_65C02" +.endif + +.if (.cpu .bitand CPU_ISET_65816) + .byte 0,"CPU_ISET_65816" +.endif + +.if (.cpu .bitand CPU_ISET_SWEET16) + .byte 0,"CPU_ISET_SWEET16" +.endif + +.if (.cpu .bitand CPU_ISET_HUC6280) + .byte 0,"CPU_ISET_HUC6280" +.endif + +.if (.cpu .bitand CPU_ISET_4510) + .byte 0,"CPU_ISET_4510" +.endif + diff --git a/test/asm/huc6280-cpudetect.ref b/test/asm/huc6280-cpudetect.ref new file mode 100644 index 000000000..646e0f48c Binary files /dev/null and b/test/asm/huc6280-cpudetect.ref differ diff --git a/test/asm/huc6280-opcodes.ref b/test/asm/huc6280-opcodes.ref new file mode 100644 index 000000000..33f5b297f Binary files /dev/null and b/test/asm/huc6280-opcodes.ref differ diff --git a/test/asm/huc6280-opcodes.s b/test/asm/huc6280-opcodes.s new file mode 100644 index 000000000..bd3ad5c79 --- /dev/null +++ b/test/asm/huc6280-opcodes.s @@ -0,0 +1,258 @@ +.setcpu "huc6280" + + brk + ora ($12,x) + sxy + st0 #$12 + tsb $12 + ora $12 + asl $12 + rmb0 $12 + php + ora #$12 + asl a + .byte $0B + tsb $3456 + ora $3456 + asl $3456 + bbr0 $12,*+122 + bpl *+122 + ora ($12),y + ora ($12) + st1 #$12 + trb $12 + ora $12,x + asl $12,x + rmb1 $12 + clc + ora $3456,y + inc a + .byte $1B + trb $3456 + ora $3456,x + asl $3456,x + bbr1 $12,*+122 + jsr $3456 + and ($12,x) + sax + st2 #$12 + bit $12 + and $12 + rol $12 + rmb2 $12 + plp + and #$12 + rol a + .byte $2B + bit $3456 + and $3456 + rol $3456 + bbr2 $12,*+122 + bmi *+122 + and ($12),y + and ($12) + .byte $33 + bit $12,x + and $12,x + rol $12,x + rmb3 $12 + sec + and $3456,y + dec a + .byte $3B + bit $3456,x + and $3456,x + rol $3456,x + bbr3 $12,*+122 + rti + eor ($12,x) + say + tma #$02 + bsr *+122 + eor $12 + lsr $12 + rmb4 $12 + pha + eor #$12 + lsr a + .byte $4B + jmp $3456 + eor $3456 + lsr $3456 + bbr4 $12,*+122 + bvc *+122 + eor ($12),y + eor ($12) + tam #$12 + csl + eor $12,x + lsr $12,x + rmb5 $12 + cli + eor $3456,y + phy + .byte $5B + .byte $5C + eor $3456,x + lsr $3456,x + bbr5 $12,*+122 + rts + adc ($12,x) + cla + .byte $63 + stz $12 + adc $12 + ror $12 + rmb6 $12 + pla + adc #$12 + ror a + .byte $6B + jmp ($3456) + adc $3456 + ror $3456 + bbr6 $12,*+122 + bvs *+122 + adc ($12),y + adc ($12) + tii $3333,$7373,$1111 + stz $12,x + adc $12,x + ror $12,x + rmb7 $12 + sei + adc $3456,y + ply + .byte $7B + jmp ($3456,x) + adc $3456,x + ror $3456,x + bbr7 $12,*+122 + bra *+122 + sta ($12,x) + clx + tst #$12,$EA + sty $12 + sta $12 + stx $12 + smb0 $12 + dey + bit #$12 + txa + .byte $8B + sty $3456 + sta $3456 + stx $3456 + bbs0 $12,*+122 + bcc *+122 + sta ($12),y + sta ($12) + tst #$12,$EAEA + sty $12,x + sta $12,x + stx $12,y + smb1 $12 + tya + sta $3456,y + txs + .byte $9B + stz $3456 + sta $3456,x + stz $3456,x + bbs1 $12,*+122 + ldy #$12 + lda ($12,x) + ldx #$12 + tst #$12,$EA,x + ldy $12 + lda $12 + ldx $12 + smb2 $12 + tay + lda #$12 + tax + .byte $AB + ldy $3456 + lda $3456 + ldx $3456 + bbs2 $12,*+122 + bcs *+122 + lda ($12),y + lda ($12) + tst #$12,$EAEA,x + ldy $12,x + lda $12,x + ldx $12,y + smb3 $12 + clv + lda $3456,y + tsx + .byte $BB + ldy $3456,x + lda $3456,x + ldx $3456,y + bbs3 $12,*+122 + cpy #$12 + cmp ($12,x) + cly + tdd $3333,$C3C3,$1111 + cpy $12 + cmp $12 + dec $12 + smb4 $12 + iny + cmp #$12 + dex + .byte $CB + cpy $3456 + cmp $3456 + dec $3456 + bbs4 $12,*+122 + bne *+122 + cmp ($12),y + cmp ($12) + tin $3333,$D3D3,$1111 + .byte $D4 + cmp $12,x + dec $12,x + smb5 $12 + cld + cmp $3456,y + phx + .byte $DB + .byte $DC + cmp $3456,x + dec $3456,x + bbs5 $12,*+122 + cpx #$12 + sbc ($12,x) + .byte $E2 + tia $3333,$E3E3,$1111 + cpx $12 + sbc $12 + inc $12 + smb6 $12 + inx + sbc #$12 + nop + .byte $EB + cpx $3456 + sbc $3456 + inc $3456 + bbs6 $12,*+122 + beq *+122 + sbc ($12),y + sbc ($12) + tai $3333,$F3F3,$1111 + .byte $F4 + sbc $12,x + inc $12,x + smb7 $12 + sed + sbc $3456,y + plx + .byte $FB + .byte $FC + sbc $3456,x + inc $3456,x + bbs7 $12,*+122 diff --git a/test/asm/m740-opcodes.s b/test/asm/m740-opcodes.s new file mode 100644 index 000000000..df6d71488 --- /dev/null +++ b/test/asm/m740-opcodes.s @@ -0,0 +1,260 @@ +.setcpu "65C02" +; copy of 65c02, comments note changes to the m740 according to +; http://documentation.renesas.com/doc/products/mpumcu/rej09b0322_740sm.pdf + + brk + ora ($12,x) + .byte $02,$00,$00 ; jsr zp,ind + .byte $03,$00,$00 ; bbs 0,a + tsb $12 ; .byte $04 + ora $12 + asl $12 + rmb0 $12 ; bbs 0,zp + php + ora #$12 + asl a + .byte $0B,$00,$00 ; seb 0,a + tsb $3456 ; .byte $0c + ora $3456 + asl $3456 + bbr0 $12,*+122 ; seb 0,zp + bpl *+122 + ora ($12),y + ora ($12) ; clt + .byte $13,$00,$00 ; bbc 0,a + trb $12 ; .byte $14 + ora $12,x + asl $12,x + rmb1 $12 ; bbc 0,zp + clc + ora $3456,y + inc a + .byte $1B,$00,$00 ; clb 0,a + trb $3456 ; .byte $1c + ora $3456,x + asl $3456,x + bbr1 $12,*+122 ; clb 0,zp + jsr $3456 + and ($12,x) + .byte $22,$00,$00 ; jsr sp + .byte $23,$00,$00 ; bbs 1,a + bit $12 + and $12 + rol $12 + rmb2 $12 ; bbs 1,zp + plp + and #$12 + rol a + .byte $2B,$00,$00 ; seb 1,a + bit $3456 + and $3456 + rol $3456 + bbr2 $12,*+122 ; seb 1,zp + bmi *+122 + and ($12),y + and ($12) ; set + .byte $33,$00,$00 ; bbc 1,a + bit $12,x ; .byte $34 + and $12,x + rol $12,x + rmb3 $12 ; bbc 1,zp + sec + and $3456,y + dec a + .byte $3B,$00,$00 ; clb 1,a + bit $3456,x ; ldm zp + and $3456,x + rol $3456,x + bbr3 $12,*+122 ; clb 1,zp + rti + eor ($12,x) + .byte $42,$00,$00 ; stp + .byte $43,$00,$00 ; bbs 2,a + .byte $44,$00,$00 ; com zp + eor $12 + lsr $12 + rmb4 $12 ; bbs 2,zp + pha + eor #$12 + lsr a + .byte $4B,$00,$00 ; seb 2,a + jmp $3456 + eor $3456 + lsr $3456 + bbr4 $12,*+122 ; seb 2,zp + bvc *+122 + eor ($12),y + eor ($12) ; .byte $52 + .byte $53,$00,$00 ; bbc 2,a + .byte $54,$00,$00 + eor $12,x + lsr $12,x + rmb5 $12 ; bbc 2,zp + cli + eor $3456,y + phy + .byte $5B,$00,$00 ; clb 2,a + .byte $5C,$00,$00 + eor $3456,x + lsr $3456,x + bbr5 $12,*+122 ; clb 2,zp + rts + adc ($12,x) + .byte $62,$00,$00 ; mul zp,x + .byte $63,$00,$00 ; bbs 3,a + stz $12 ; tst zp + adc $12 + ror $12 + rmb6 $12 ; bbs 3,zp + pla + adc #$12 + ror a + .byte $6B,$00,$00 ; seb 3,a + jmp ($3456) + adc $3456 + ror $3456 + bbr6 $12,*+122 ; seb 3,zp + bvs *+122 + adc ($12),y + adc ($12) ; .byte $72 + .byte $73,$00,$00 ; bbc 3,a + stz $12,x ; .byte $74 + adc $12,x + ror $12,x + rmb7 $12 ; bbc 3,zp + sei + adc $3456,y + ply + .byte $7B,$00,$00 ; clb 3,a + jmp ($3456,x) ; .byte $7c + adc $3456,x + ror $3456,x + bbr7 $12,*+122 ; clb 3,zp + bra *+122 + sta ($12,x) + .byte $82,$00,$00 ; rrf zp + .byte $83,$00,$00 ; bbs 4,a + sty $12 + sta $12 + stx $12 + smb0 $12 ; bbs 4,zp + dey + bit #$12 + txa + .byte $8B,$00,$00 ; seb 4,a + sty $3456 + sta $3456 + stx $3456 + bbs0 $12,*+122 ; seb 4,zp + bcc *+122 + sta ($12),y + sta ($12) ; .byte $92 + .byte $93,$00,$00 ; bbc 4,a + sty $12,x + sta $12,x + stx $12,y + smb1 $12 ; bbc 4,zp + tya + sta $3456,y + txs + .byte $9B,$00,$00 ; clb 4,a + stz $3456 ; .byte $9c + sta $3456,x + stz $3456,x ; .byte $9e + bbs1 $12,*+122 ; clb 4,zp + ldy #$12 + lda ($12,x) + ldx #$12 + .byte $A3,$00,$00 ; bbs 5,a + ldy $12 + lda $12 + ldx $12 + smb2 $12 ; bbs 5,zp + tay + lda #$12 + tax + .byte $AB,$00,$00 ; seb 5,a + ldy $3456 + lda $3456 + ldx $3456 + bbs2 $12,*+122 ; seb 5,zp + bcs *+122 + lda ($12),y + lda ($12) ; .byte $b2 + .byte $B3,$00,$00 ; bbc 5,a + ldy $12,x + lda $12,x + ldx $12,y + smb3 $12 ; bbc 5,zp + clv + lda $3456,y + tsx + .byte $BB,$00,$00 ; clb 5,a + ldy $3456,x + lda $3456,x + ldx $3456,y + bbs3 $12,*+122 ; clb 5,zp + cpy #$12 + cmp ($12,x) + .byte $C2,$00,$00 ; wit + .byte $C3,$00,$00 ; bbs 6,a + cpy $12 + cmp $12 + dec $12 + smb4 $12 ; bbs 6,zp + iny + cmp #$12 + dex + .byte $CB,$00,$00 ; seb 6,a + cpy $3456 + cmp $3456 + dec $3456 + bbs4 $12,*+122 ; seb 6,zp + bne *+122 + cmp ($12),y + cmp ($12) ; .byte $d2 + .byte $D3,$00,$00 ; bbc 6,a + .byte $D4,$00,$00 + cmp $12,x + dec $12,x + smb5 $12 ; bbc 6,zp + cld + cmp $3456,y + phx + .byte $DB,$00,$00 ; clb 6,a + .byte $DC,$00,$00 + cmp $3456,x + dec $3456,x + bbs5 $12,*+122 ; clb 6,zp + cpx #$12 + sbc ($12,x) + .byte $E2,$00,$00 ; div zp,x + .byte $E3,$00,$00 ; bbs 7,a + cpx $12 + sbc $12 + inc $12 + smb6 $12 ; bbs 7,zp + inx + sbc #$12 + nop + .byte $EB,$00,$00 ; seb 7,a + cpx $3456 + sbc $3456 + inc $3456 + bbs6 $12,*+122 ; seb 7,zp + beq *+122 + sbc ($12),y + sbc ($12) ; .byte $f2 + .byte $F3,$00,$00 ; bbc 7,a + .byte $F4,$00,$00 + sbc $12,x + inc $12,x + smb7 $12 ; bbc 7,zp + sed + sbc $3456,y + plx + .byte $FB,$00,$00 ; clb 7,a + .byte $FC,$00,$00 + sbc $3456,x + inc $3456,x + bbs7 $12,*+122 ; clb 7,zp diff --git a/test/assembler/4510-cpudetect.ref b/test/assembler/4510-cpudetect.ref deleted file mode 100644 index 515557c85..000000000 Binary files a/test/assembler/4510-cpudetect.ref and /dev/null differ diff --git a/test/assembler/4510-opcodes.ref b/test/assembler/4510-opcodes.ref deleted file mode 100644 index b65b12e61..000000000 Binary files a/test/assembler/4510-opcodes.ref and /dev/null differ diff --git a/test/assembler/4510-opcodes.s b/test/assembler/4510-opcodes.s deleted file mode 100644 index 3d6805674..000000000 --- a/test/assembler/4510-opcodes.s +++ /dev/null @@ -1,278 +0,0 @@ -.setcpu "4510" - - brk - ora ($05,x) - cle - see - tsb $02 - ora $02 - asl $02 - rmb0 $02 - php - ora #$01 - asl - tsy - tsb $1234 - ora $1234 - asl $1234 - bbr0 $02,*+$34 - - bpl *+$32 - ora ($06),y - ora ($07),z - lbpl *+$3133 ; bpl *+$3133 - trb $02 - ora $03,x - asl $03,x - rmb1 $02 - clc - ora $1456,y - inc - inz - trb $1234 - ora $1345,x - asl $1345,x - bbr1 $02,*+$34 - - jsr $1234 - and ($05,x) - jsr ($2345) - jsr ($2456,x) - bit $02 - and $02 - rol $02 - rmb2 $02 - plp - and #$01 - rol - tys - bit $1234 - and $1234 - rol $1234 - bbr2 $02,*+$34 - - bmi *+$32 - and ($06),y - and ($07),z - lbmi *+$3133 ; bmi *+$3133 - bit $03,x - and $03,x - rol $03,x - rmb3 $02 - sec - and $1456,y - dec - dez - bit $1345,x - and $1345,x - rol $1345,x - bbr3 $02,*+$34 - - rti - eor ($05,x) - neg - asr - asr $02 - eor $02 - lsr $02 - rmb4 $02 - pha - eor #$01 - lsr - taz - jmp $1234 - eor $1234 - lsr $1234 - bbr4 $02,*+$34 - - bvc *+$32 - eor ($06),y - eor ($07),z - lbvc *+$3133 ; bvc *+$3133 - asr $03,x - eor $03,x - lsr $03,x - rmb5 $02 - cli - eor $1456,y - phy - tab - map - eor $1345,x - lsr $1345,x - bbr5 $02,*+$34 - - rts - adc ($05,x) - rtn #$09 - bsr *+$3133 - stz $02 - adc $02 - ror $02 - rmb6 $02 - pla - adc #$01 - ror - tza - jmp ($2345) - adc $1234 - ror $1234 - bbr6 $02,*+$34 - - bvs *+$32 - adc ($06),y - adc ($07),z - lbvs *+$3133 ; bvs *+$3133 - stz $03,x - adc $03,x - ror $03,x - rmb7 $02 - sei - adc $1456,y - ply - tba - jmp ($2456,x) - adc $1345,x - ror $1345,x - bbr7 $02,*+$34 - - bra *+$32 - sta ($05,x) - sta ($0f,s),y - sta ($0f,sp),y - lbra *+$3133 ; bra *+$3133 - sty $02 - sta $02 - stx $02 - smb0 $02 - dey - bit #$01 - txa - sty $1345,x - sty $1234 - sta $1234 - stx $1234 - bbs0 $02,*+$34 - - bcc *+$32 - sta ($06),y - sta ($07),z - lbcc *+$3133 ; bcc *+$3133 - sty $03,x - sta $03,x - stx $04,y - smb1 $02 - tya - sta $1456,y - txs - stx $1456,y - stz $1234 - sta $1345,x - stz $1345,x - bbs1 $02,*+$34 - - ldy #$01 - lda ($05,x) - ldx #$01 - ldz #$01 - ldy $02 - lda $02 - ldx $02 - smb2 $02 - tay - lda #$01 - tax - ldz $1234 - ldy $1234 - lda $1234 - ldx $1234 - bbs2 $02,*+$34 - - bcs *+$32 - lda ($06),y - lda ($07),z - lbcs *+$3133 ; bcs *+$3133 - ldy $03,x - lda $03,x - ldx $04,y - smb3 $02 - clv - lda $1456,y - tsx - ldz $1345,x - ldy $1345,x - lda $1345,x - ldx $1456,y - bbs3 $02,*+$34 - - cpy #$01 - cmp ($05,x) - cpz #$01 - dew $02 - cpy $02 - cmp $02 - dec $02 - smb4 $02 - iny - cmp #$01 - dex - asw $1234 - cpy $1234 - cmp $1234 - dec $1234 - bbs4 $02,*+$34 - - bne *+$32 - cmp ($06),y - cmp ($07),z - lbne *+$3133 ; bne *+$3133 - cpz $02 - cmp $03,x - dec $03,x - smb5 $02 - cld - cmp $1456,y - phx - phz - cpz $1234 - cmp $1345,x - dec $1345,x - bbs5 $02,*+$34 - - cpx #$01 - sbc ($05,x) - lda ($0f,s),y - lda ($0f,sp),y - inw $02 - cpx $02 - sbc $02 - inc $02 - smb6 $02 - inx - sbc #$01 - eom - nop - row $1234 - cpx $1234 - sbc $1234 - inc $1234 - bbs6 $02,*+$34 - - beq *+$32 - sbc ($06),y - sbc ($07),z - lbeq *+$3133 ; beq *+$3133 - phd #$089a - phw #$089a - sbc $03,x - inc $03,x - smb7 $02 - sed - sbc $1456,y - plx - plz - phd $1234 - phw $1234 - sbc $1345,x - inc $1345,x - bbs7 $02,*+$34 diff --git a/test/assembler/6502-cpudetect.ref b/test/assembler/6502-cpudetect.ref deleted file mode 100644 index 9b0aeb1f0..000000000 Binary files a/test/assembler/6502-cpudetect.ref and /dev/null differ diff --git a/test/assembler/6502-opcodes.ref b/test/assembler/6502-opcodes.ref deleted file mode 100644 index c12fa8fd6..000000000 Binary files a/test/assembler/6502-opcodes.ref and /dev/null differ diff --git a/test/assembler/6502-opcodes.s b/test/assembler/6502-opcodes.s deleted file mode 100644 index 5cb94c29f..000000000 --- a/test/assembler/6502-opcodes.s +++ /dev/null @@ -1,257 +0,0 @@ -.setcpu "6502" - - brk - ora ($12,x) - .byte $02 - .byte $03 - .byte $04 - ora $12 - asl $12 - .byte $07 - php - ora #$12 - asl a - .byte $0B - .byte $0C - ora $3456 - asl $3456 - .byte $0F - bpl *+122 - ora ($12),y - .byte $12 - .byte $13 - .byte $14 - ora $12,x - asl $12,x - .byte $17 - clc - ora $3456,y - .byte $1A - .byte $1B - .byte $1C - ora $3456,x - asl $3456,x - .byte $1F - jsr $3456 - and ($12,x) - .byte $22 - .byte $23 - bit $12 - and $12 - rol $12 - .byte $27 - plp - and #$12 - rol a - .byte $2B - bit $3456 - and $3456 - rol $3456 - .byte $2F - bmi *+122 - and ($12),y - .byte $32 - .byte $33 - .byte $34 - and $12,x - rol $12,x - .byte $37 - sec - and $3456,y - .byte $3A - .byte $3B - .byte $3C - and $3456,x - rol $3456,x - .byte $3F - rti - eor ($12,x) - .byte $42 - .byte $43 - .byte $44 - eor $12 - lsr $12 - .byte $47 - pha - eor #$12 - lsr a - .byte $4B - jmp $3456 - eor $3456 - lsr $3456 - .byte $4F - bvc *+122 - eor ($12),y - .byte $52 - .byte $53 - .byte $54 - eor $12,x - lsr $12,x - .byte $57 - cli - eor $3456,y - .byte $5A - .byte $5B - .byte $5C - eor $3456,x - lsr $3456,x - .byte $5F - rts - adc ($12,x) - .byte $62 - .byte $63 - .byte $64 - adc $12 - ror $12 - .byte $67 - pla - adc #$12 - ror a - .byte $6B - jmp ($3456) - adc $3456 - ror $3456 - .byte $6F - bvs *+122 - adc ($12),y - .byte $72 - .byte $73 - .byte $74 - adc $12,x - ror $12,x - .byte $77 - sei - adc $3456,y - .byte $7A - .byte $7B - .byte $7C - adc $3456,x - ror $3456,x - .byte $7F - .byte $80 - sta ($12,x) - .byte $82 - .byte $83 - sty $12 - sta $12 - stx $12 - .byte $87 - dey - .byte $89 - txa - .byte $8B - sty $3456 - sta $3456 - stx $3456 - .byte $8F - bcc *+122 - sta ($12),y - .byte $92 - .byte $93 - sty $12,x - sta $12,x - stx $12,y - .byte $97 - tya - sta $3456,y - txs - .byte $9B - .byte $9C - sta $3456,x - .byte $9E - .byte $9F - ldy #$12 - lda ($12,x) - ldx #$12 - .byte $A3 - ldy $12 - lda $12 - ldx $12 - .byte $A7 - tay - lda #$12 - tax - .byte $AB - ldy $3456 - lda $3456 - ldx $3456 - .byte $AF - bcs *+122 - lda ($12),y - .byte $B2 - .byte $B3 - ldy $12,x - lda $12,x - ldx $12,y - .byte $B7 - clv - lda $3456,y - tsx - .byte $BB - ldy $3456,x - lda $3456,x - ldx $3456,y - .byte $BF - cpy #$12 - cmp ($12,x) - .byte $C2 - .byte $C3 - cpy $12 - cmp $12 - dec $12 - .byte $C7 - iny - cmp #$12 - dex - .byte $CB - cpy $3456 - cmp $3456 - dec $3456 - .byte $CF - bne *+122 - cmp ($12),y - .byte $D2 - .byte $D3 - .byte $D4 - cmp $12,x - dec $12,x - .byte $D7 - cld - cmp $3456,y - .byte $DA - .byte $DB - .byte $DC - cmp $3456,x - dec $3456,x - .byte $DF - cpx #$12 - sbc ($12,x) - .byte $E2 - .byte $E3 - cpx $12 - sbc $12 - inc $12 - .byte $E7 - inx - sbc #$12 - .byte $EB - cpx $3456 - sbc $3456 - inc $3456 - .byte $EF - beq *+122 - sbc ($12),y - .byte $F2 - .byte $F3 - .byte $F4 - sbc $12,x - inc $12,x - .byte $F7 - sed - sbc $3456,y - .byte $FA - .byte $FB - .byte $FC - sbc $3456,x - inc $3456,x - .byte $FF diff --git a/test/assembler/6502x-cpudetect.ref b/test/assembler/6502x-cpudetect.ref deleted file mode 100644 index 3434ecbea..000000000 Binary files a/test/assembler/6502x-cpudetect.ref and /dev/null differ diff --git a/test/assembler/6502x-opcodes.ref b/test/assembler/6502x-opcodes.ref deleted file mode 100644 index f942bec76..000000000 Binary files a/test/assembler/6502x-opcodes.ref and /dev/null differ diff --git a/test/assembler/6502x-opcodes.s b/test/assembler/6502x-opcodes.s deleted file mode 100644 index 5f21aeb9f..000000000 --- a/test/assembler/6502x-opcodes.s +++ /dev/null @@ -1,258 +0,0 @@ -.setcpu "6502X" - - brk - ora ($12,x) - jam - slo ($12,x) - nop $12 - ora $12 - asl $12 - slo $12 - php - ora #$12 - asl a - anc #$12 - nop $3456 - ora $3456 - asl $3456 - slo $3456 - bpl *+122 - ora ($12),y - .byte $12 ; jam - slo ($12),y - nop $12,x - ora $12,x - asl $12,x - slo $12,x - clc - ora $3456,y - .byte $1a ; nop - slo $3456,y - nop $3456,x - ora $3456,x - asl $3456,x - slo $3456,x - jsr $3456 - and ($12,x) - .byte $22 ; jam - rla ($12,x) - bit $12 - and $12 - rol $12 - rla $12 - plp - and #$12 - rol a - .byte $2b ; anc #$12 - bit $3456 - and $3456 - rol $3456 - rla $3456 - bmi *+122 - and ($12),y - .byte $32 ; jam - rla ($12),y - .byte $34,$12 ; nop $12,x - and $12,x - rol $12,x - rla $12,x - sec - and $3456,y - .byte $3a ; nop - rla $3456,y - .byte $3c,$56,$34 ; nop $3456,x - and $3456,x - rol $3456,x - rla $3456,x - rti - eor ($12,x) - .byte $42 ; jam - sre ($12,x) - .byte $44,$12 ; nop $12 - eor $12 - lsr $12 - sre $12 - pha - eor #$12 - lsr a - alr #$12 - jmp $3456 - eor $3456 - lsr $3456 - sre $3456 - bvc *+122 - eor ($12),y - .byte $52 ; jam - sre ($12),y - .byte $54,$12 ; nop $12,x - eor $12,x - lsr $12,x - sre $12,x - cli - eor $3456,y - .byte $5a ; nop - sre $3456,y - nop $3456,x - eor $3456,x - lsr $3456,x - sre $3456,x - rts - adc ($12,x) - .byte $62 ; jam - rra ($12,x) - .byte $64,$12 ; nop $12 - adc $12 - ror $12 - rra $12 - pla - adc #$12 - ror a - arr #$12 - jmp ($3456) - adc $3456 - ror $3456 - rra $3456 - bvs *+122 - adc ($12),y - .byte $72 ; jam - rra ($12),y - .byte $74,$12 ; nop $12,x - adc $12,x - ror $12,x - rra $12,x - sei - adc $3456,y - .byte $7a ; nop - rra $3456,y - .byte $7c,$56,$34 ; nop $3456,x - adc $3456,x - ror $3456,x - rra $3456,x - nop #$12 - sta ($12,x) - .byte $82,$12 ; nop #$12 - sax ($12,x) - sty $12 - sta $12 - stx $12 - sax $12 - dey - .byte $89,$12 ; nop #$12 - txa - .byte $8b,$12 ; xaa #$12 - sty $3456 - sta $3456 - stx $3456 - sax $3456 - bcc *+122 - sta ($12),y - .byte $92 ; jam - .byte $93,$12 ; ahx ($12),y - sty $12,x - sta $12,x - stx $12,y - sax $12,y - tya - sta $3456,y - txs - tas $3456,y - shy $3456,x - sta $3456,x - shx $3456,y - .byte $9f,$56,$34 ; ahx $3456,y - ldy #$12 - lda ($12,x) - ldx #$12 - lax ($12,x) - ldy $12 - lda $12 - ldx $12 - lax $12 - tay - lda #$12 - tax - lax #$12 - ldy $3456 - lda $3456 - ldx $3456 - lax $3456 - bcs *+122 - lda ($12),y - .byte $b2 ; jam - lax ($12),y - ldy $12,x - lda $12,x - ldx $12,y - lax $12,y - clv - lda $3456,y - tsx - las $3456,y - ldy $3456,x - lda $3456,x - ldx $3456,y - lax $3456,y - cpy #$12 - cmp ($12,x) - .byte $c2,$12 ; nop #$12 - dcp ($12,x) - cpy $12 - cmp $12 - dec $12 - dcp $12 - iny - cmp #$12 - dex - axs #$12 - cpy $3456 - cmp $3456 - dec $3456 - dcp $3456 - bne *+122 - cmp ($12),y - .byte $d2 ; jam - dcp ($12),y - .byte $d4,$12 ; nop $12,x - cmp $12,x - dec $12,x - dcp $12,x - cld - cmp $3456,y - .byte $da ; nop - dcp $3456,y - .byte $dc,$56,$34 ; nop $3456,x - cmp $3456,x - dec $3456,x - dcp $3456,x - cpx #$12 - sbc ($12,x) - .byte $e2,$12 ; nop #$12 - isc ($12,x) - cpx $12 - sbc $12 - inc $12 - isc $12 - inx - sbc #$12 - nop - .byte $eb ; nop - cpx $3456 - sbc $3456 - inc $3456 - isc $3456 - beq *+122 - sbc ($12),y - .byte $f2 ; jam - isc ($12),y - .byte $f4,$12 ; nop $12,x - sbc $12,x - inc $12,x - isc $12,x - sed - sbc $3456,y - .byte $fa ; nop - isc $3456,y - .byte $fc,$56,$34 ; nop $3456,x - sbc $3456,x - inc $3456,x - isc $3456,x diff --git a/test/assembler/65816-cpudetect.ref b/test/assembler/65816-cpudetect.ref deleted file mode 100644 index 4f6e767b0..000000000 Binary files a/test/assembler/65816-cpudetect.ref and /dev/null differ diff --git a/test/assembler/65c02-cpudetect.ref b/test/assembler/65c02-cpudetect.ref deleted file mode 100644 index 9f790d5ff..000000000 Binary files a/test/assembler/65c02-cpudetect.ref and /dev/null differ diff --git a/test/assembler/65c02-opcodes.ref b/test/assembler/65c02-opcodes.ref deleted file mode 100644 index 2d44045cb..000000000 Binary files a/test/assembler/65c02-opcodes.ref and /dev/null differ diff --git a/test/assembler/65c02-opcodes.s b/test/assembler/65c02-opcodes.s deleted file mode 100644 index 09c3f04f2..000000000 --- a/test/assembler/65c02-opcodes.s +++ /dev/null @@ -1,258 +0,0 @@ -.setcpu "65C02" - - brk - ora ($12,x) - .byte $02 - .byte $03 - tsb $12 - ora $12 - asl $12 - rmb0 $12 - php - ora #$12 - asl a - .byte $0B - tsb $3456 - ora $3456 - asl $3456 - bbr0 $12,*+122 - bpl *+122 - ora ($12),y - ora ($12) - .byte $13 - trb $12 - ora $12,x - asl $12,x - rmb1 $12 - clc - ora $3456,y - inc a - .byte $1B - trb $3456 - ora $3456,x - asl $3456,x - bbr1 $12,*+122 - jsr $3456 - and ($12,x) - .byte $22 - .byte $23 - bit $12 - and $12 - rol $12 - rmb2 $12 - plp - and #$12 - rol a - .byte $2B - bit $3456 - and $3456 - rol $3456 - bbr2 $12,*+122 - bmi *+122 - and ($12),y - and ($12) - .byte $33 - bit $12,x - and $12,x - rol $12,x - rmb3 $12 - sec - and $3456,y - dec a - .byte $3B - bit $3456,x - and $3456,x - rol $3456,x - bbr3 $12,*+122 - rti - eor ($12,x) - .byte $42 - .byte $43 - .byte $44 - eor $12 - lsr $12 - rmb4 $12 - pha - eor #$12 - lsr a - .byte $4B - jmp $3456 - eor $3456 - lsr $3456 - bbr4 $12,*+122 - bvc *+122 - eor ($12),y - eor ($12) - .byte $53 - .byte $54 - eor $12,x - lsr $12,x - rmb5 $12 - cli - eor $3456,y - phy - .byte $5B - .byte $5C - eor $3456,x - lsr $3456,x - bbr5 $12,*+122 - rts - adc ($12,x) - .byte $62 - .byte $63 - stz $12 - adc $12 - ror $12 - rmb6 $12 - pla - adc #$12 - ror a - .byte $6B - jmp ($3456) - adc $3456 - ror $3456 - bbr6 $12,*+122 - bvs *+122 - adc ($12),y - adc ($12) - .byte $73 - stz $12,x - adc $12,x - ror $12,x - rmb7 $12 - sei - adc $3456,y - ply - .byte $7B - jmp ($3456,x) - adc $3456,x - ror $3456,x - bbr7 $12,*+122 - bra *+122 - sta ($12,x) - .byte $82 - .byte $83 - sty $12 - sta $12 - stx $12 - smb0 $12 - dey - bit #$12 - txa - .byte $8B - sty $3456 - sta $3456 - stx $3456 - bbs0 $12,*+122 - bcc *+122 - sta ($12),y - sta ($12) - .byte $93 - sty $12,x - sta $12,x - stx $12,y - smb1 $12 - tya - sta $3456,y - txs - .byte $9B - stz $3456 - sta $3456,x - stz $3456,x - bbs1 $12,*+122 - ldy #$12 - lda ($12,x) - ldx #$12 - .byte $A3 - ldy $12 - lda $12 - ldx $12 - smb2 $12 - tay - lda #$12 - tax - .byte $AB - ldy $3456 - lda $3456 - ldx $3456 - bbs2 $12,*+122 - bcs *+122 - lda ($12),y - lda ($12) - .byte $B3 - ldy $12,x - lda $12,x - ldx $12,y - smb3 $12 - clv - lda $3456,y - tsx - .byte $BB - ldy $3456,x - lda $3456,x - ldx $3456,y - bbs3 $12,*+122 - cpy #$12 - cmp ($12,x) - .byte $C2 - .byte $C3 - cpy $12 - cmp $12 - dec $12 - smb4 $12 - iny - cmp #$12 - dex - .byte $CB - cpy $3456 - cmp $3456 - dec $3456 - bbs4 $12,*+122 - bne *+122 - cmp ($12),y - cmp ($12) - .byte $D3 - .byte $D4 - cmp $12,x - dec $12,x - smb5 $12 - cld - cmp $3456,y - phx - .byte $DB - .byte $DC - cmp $3456,x - dec $3456,x - bbs5 $12,*+122 - cpx #$12 - sbc ($12,x) - .byte $E2 - .byte $E3 - cpx $12 - sbc $12 - inc $12 - smb6 $12 - inx - sbc #$12 - nop - .byte $EB - cpx $3456 - sbc $3456 - inc $3456 - bbs6 $12,*+122 - beq *+122 - sbc ($12),y - sbc ($12) - .byte $F3 - .byte $F4 - sbc $12,x - inc $12,x - smb7 $12 - sed - sbc $3456,y - plx - .byte $FB - .byte $FC - sbc $3456,x - inc $3456,x - bbs7 $12,*+122 diff --git a/test/assembler/65sc02-cpudetect.ref b/test/assembler/65sc02-cpudetect.ref deleted file mode 100644 index 4e11bd708..000000000 Binary files a/test/assembler/65sc02-cpudetect.ref and /dev/null differ diff --git a/test/assembler/65sc02-opcodes.ref b/test/assembler/65sc02-opcodes.ref deleted file mode 100644 index d22fe6688..000000000 Binary files a/test/assembler/65sc02-opcodes.ref and /dev/null differ diff --git a/test/assembler/65sc02-opcodes.s b/test/assembler/65sc02-opcodes.s deleted file mode 100644 index aa539913a..000000000 --- a/test/assembler/65sc02-opcodes.s +++ /dev/null @@ -1,258 +0,0 @@ -.setcpu "65SC02" - - brk - ora ($12,x) - .byte $02 - .byte $03 - tsb $12 - ora $12 - asl $12 - .byte $07 - php - ora #$12 - asl a - .byte $0B - tsb $3456 - ora $3456 - asl $3456 - .byte $0F - bpl *+122 - ora ($12),y - ora ($12) - .byte $13 - trb $12 - ora $12,x - asl $12,x - .byte $17 - clc - ora $3456,y - inc a - .byte $1B - trb $3456 - ora $3456,x - asl $3456,x - .byte $1F - jsr $3456 - and ($12,x) - .byte $22 - .byte $23 - bit $12 - and $12 - rol $12 - .byte $27 - plp - and #$12 - rol a - .byte $2B - bit $3456 - and $3456 - rol $3456 - .byte $2F - bmi *+122 - and ($12),y - and ($12) - .byte $33 - bit $12,x - and $12,x - rol $12,x - .byte $37 - sec - and $3456,y - dec a - .byte $3B - bit $3456,x - and $3456,x - rol $3456,x - .byte $3F - rti - eor ($12,x) - .byte $42 - .byte $43 - .byte $44 - eor $12 - lsr $12 - .byte $47 - pha - eor #$12 - lsr a - .byte $4B - jmp $3456 - eor $3456 - lsr $3456 - .byte $4F - bvc *+122 - eor ($12),y - eor ($12) - .byte $53 - .byte $54 - eor $12,x - lsr $12,x - .byte $57 - cli - eor $3456,y - phy - .byte $5B - .byte $5C - eor $3456,x - lsr $3456,x - .byte $5F - rts - adc ($12,x) - .byte $62 - .byte $63 - stz $12 - adc $12 - ror $12 - .byte $67 - pla - adc #$12 - ror a - .byte $6B - jmp ($3456) - adc $3456 - ror $3456 - .byte $6F - bvs *+122 - adc ($12),y - adc ($12) - .byte $73 - stz $12,x - adc $12,x - ror $12,x - .byte $77 - sei - adc $3456,y - ply - .byte $7B - jmp ($3456,x) - adc $3456,x - ror $3456,x - .byte $7F - bra *+122 - sta ($12,x) - .byte $82 - .byte $83 - sty $12 - sta $12 - stx $12 - .byte $87 - dey - bit #$12 - txa - .byte $8B - sty $3456 - sta $3456 - stx $3456 - .byte $8F - bcc *+122 - sta ($12),y - sta ($12) - .byte $93 - sty $12,x - sta $12,x - stx $12,y - .byte $97 - tya - sta $3456,y - txs - .byte $9B - stz $3456 - sta $3456,x - stz $3456,x - .byte $9F - ldy #$12 - lda ($12,x) - ldx #$12 - .byte $A3 - ldy $12 - lda $12 - ldx $12 - .byte $A7 - tay - lda #$12 - tax - .byte $AB - ldy $3456 - lda $3456 - ldx $3456 - .byte $AF - bcs *+122 - lda ($12),y - lda ($12) - .byte $B3 - ldy $12,x - lda $12,x - ldx $12,y - .byte $B7 - clv - lda $3456,y - tsx - .byte $BB - ldy $3456,x - lda $3456,x - ldx $3456,y - .byte $BF - cpy #$12 - cmp ($12,x) - .byte $C2 - .byte $C3 - cpy $12 - cmp $12 - dec $12 - .byte $C7 - iny - cmp #$12 - dex - .byte $CB - cpy $3456 - cmp $3456 - dec $3456 - .byte $CF - bne *+122 - cmp ($12),y - cmp ($12) - .byte $D3 - .byte $D4 - cmp $12,x - dec $12,x - .byte $D7 - cld - cmp $3456,y - phx - .byte $DB - .byte $DC - cmp $3456,x - dec $3456,x - .byte $DF - cpx #$12 - sbc ($12,x) - .byte $E2 - .byte $E3 - cpx $12 - sbc $12 - inc $12 - .byte $E7 - inx - sbc #$12 - nop - .byte $EB - cpx $3456 - sbc $3456 - inc $3456 - .byte $EF - beq *+122 - sbc ($12),y - sbc ($12) - .byte $F3 - .byte $F4 - sbc $12,x - inc $12,x - .byte $F7 - sed - sbc $3456,y - plx - .byte $FB - .byte $FC - sbc $3456,x - inc $3456,x - .byte $FF diff --git a/test/assembler/Makefile b/test/assembler/Makefile deleted file mode 100644 index fb840446c..000000000 --- a/test/assembler/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# Makefile for the assembler regression tests - -ifneq ($(shell echo),) - CMD_EXE = 1 -endif - -ifdef CMD_EXE - EXE = .exe - MKDIR = mkdir $(subst /,\,$1) - RMDIR = -rmdir /s /q $(subst /,\,$1) - DEL = del /f $(subst /,\,$1) -else - EXE = - MKDIR = mkdir -p $1 - RMDIR = $(RM) -r $1 - DEL = $(RM) $1 -endif - -CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65) - -WORKDIR = ../../testwrk/asm - -DIFF = $(WORKDIR)/bdiff$(EXE) - -CC = gcc -CFLAGS = -O2 - -.PHONY: all clean - -OPCODE_REFS := $(wildcard *-opcodes.ref) -OPCODE_CPUS = $(foreach ref,$(OPCODE_REFS),$(ref:%-opcodes.ref=%)) -OPCODE_BINS = $(foreach cpu,$(OPCODE_CPUS),$(WORKDIR)/$(cpu)-opcodes.bin) - -CPUDETECT_REFS := $(wildcard *-cpudetect.ref) -CPUDETECT_CPUS = $(foreach ref,$(CPUDETECT_REFS),$(ref:%-cpudetect.ref=%)) -CPUDETECT_BINS = $(foreach cpu,$(CPUDETECT_CPUS),$(WORKDIR)/$(cpu)-cpudetect.bin) - -all: $(OPCODE_BINS) $(CPUDETECT_BINS) - -$(WORKDIR): - $(call MKDIR,$(WORKDIR)) - -$(DIFF): ../bdiff.c | $(WORKDIR) - $(CC) $(CFLAGS) -o $@ $< - -define OPCODE_template - -$(WORKDIR)/$1-opcodes.bin: $1-opcodes.s $(DIFF) - $(CL65) --cpu $1 -t none -l $(WORKDIR)/$1-opcodes.lst -o $$@ $$< - $(DIFF) $$@ $1-opcodes.ref - -endef # OPCODE_template - -$(foreach cpu,$(OPCODE_CPUS),$(eval $(call OPCODE_template,$(cpu)))) - -define CPUDETECT_template - -$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $(DIFF) - $(CL65) --cpu $1 -t none -l $(WORKDIR)/$1-cpudetect.lst -o $$@ $$< - $(DIFF) $$@ $1-cpudetect.ref - -endef # CPUDETECT_template - -$(foreach cpu,$(CPUDETECT_CPUS),$(eval $(call CPUDETECT_template,$(cpu)))) - -clean: - @$(call RMDIR,$(WORKDIR)) - @$(call DEL,$(OPCODE_REFS:.ref=.o) cpudetect.o) diff --git a/test/assembler/README b/test/assembler/README deleted file mode 100644 index a2b1e9a41..000000000 --- a/test/assembler/README +++ /dev/null @@ -1,48 +0,0 @@ - -Assembler Testcases -=================== - -Opcode Tests: -------------- - -These testcases are inspired by the ones now removed from test/assembler. -The main purpose is to have each possible opcode generated at least once, -either by an assembly instruction or a ".byte"-placeholder. Typically -generated by disassembling a binary dump that contains data in the form -of the pattern that each opcode is stated once in order followed by easy -to recognise: - -00 00 EA 00 -01 00 EA 00 -02 00 EA 00 -[...] -fe 00 EA 00 -ff 00 EA 00 - -The disassembly is then put in a better readable form by replacing the -leftover dummy opcode parameters with something more recognizable. - -The testcases for 6502, 6502x, 65sc02, 65c02, 4510, and huc6280 have been -put together by Sven Oliver ("SvOlli") Moll, as well as a template for the -m740 instructions set. - -Still to do is to find a way to implement an opcode testcase for the 65816 -processor, since it's capable of executing instructions with an 8-bit and -a 16-bit operator alike, only distinguished by one processor flag. - - -CPU detect Tests ----------------- - -These tests all assemble the same file "cpudetect.s" which contains several -conditionals for several CPUs, only using every option known to the "--cpu" -commandline switch of ca65/cl65. - - -Reference (".ref") Files ------------------------- - -A hint on creating these files: when running the test, it will fail due to -the missing ".ref" file. Review the output of the ".lst" very pedantic, then -copy the ".bin" to the ".ref" file. - diff --git a/test/assembler/cpudetect.s b/test/assembler/cpudetect.s deleted file mode 100644 index adad7c1dc..000000000 --- a/test/assembler/cpudetect.s +++ /dev/null @@ -1,66 +0,0 @@ - -.macpack cpu - -; step 1: try to assemble an instruction that's exclusive to this set -; (when possible) - -.ifp02 - lda #$ea -.endif - -.ifpsc02 - jmp ($1234,x) -.endif - -.ifpc02 - rmb0 $12 -.endif - -.ifp816 - xba -.endif - -.ifp4510 - taz -.endif - - -; step 2: check for bitwise compatibility of instructions sets -; (made verbose for better reading with hexdump/hd(1)) - -.if (.cpu .bitand CPU_ISET_NONE) - .byte 0,"CPU_ISET_NONE" -.endif - -.if (.cpu .bitand CPU_ISET_6502) - .byte 0,"CPU_ISET_6502" -.endif - -.if (.cpu .bitand CPU_ISET_6502X) - .byte 0,"CPU_ISET_6502X" -.endif - -.if (.cpu .bitand CPU_ISET_65SC02) - .byte 0,"CPU_ISET_65SC02" -.endif - -.if (.cpu .bitand CPU_ISET_65C02) - .byte 0,"CPU_ISET_65C02" -.endif - -.if (.cpu .bitand CPU_ISET_65816) - .byte 0,"CPU_ISET_65816" -.endif - -.if (.cpu .bitand CPU_ISET_SWEET16) - .byte 0,"CPU_ISET_SWEET16" -.endif - -.if (.cpu .bitand CPU_ISET_HUC6280) - .byte 0,"CPU_ISET_HUC6280" -.endif - -.if (.cpu .bitand CPU_ISET_4510) - .byte 0,"CPU_ISET_4510" -.endif - diff --git a/test/assembler/huc6280-cpudetect.ref b/test/assembler/huc6280-cpudetect.ref deleted file mode 100644 index 646e0f48c..000000000 Binary files a/test/assembler/huc6280-cpudetect.ref and /dev/null differ diff --git a/test/assembler/huc6280-opcodes.ref b/test/assembler/huc6280-opcodes.ref deleted file mode 100644 index 33f5b297f..000000000 Binary files a/test/assembler/huc6280-opcodes.ref and /dev/null differ diff --git a/test/assembler/huc6280-opcodes.s b/test/assembler/huc6280-opcodes.s deleted file mode 100644 index bd3ad5c79..000000000 --- a/test/assembler/huc6280-opcodes.s +++ /dev/null @@ -1,258 +0,0 @@ -.setcpu "huc6280" - - brk - ora ($12,x) - sxy - st0 #$12 - tsb $12 - ora $12 - asl $12 - rmb0 $12 - php - ora #$12 - asl a - .byte $0B - tsb $3456 - ora $3456 - asl $3456 - bbr0 $12,*+122 - bpl *+122 - ora ($12),y - ora ($12) - st1 #$12 - trb $12 - ora $12,x - asl $12,x - rmb1 $12 - clc - ora $3456,y - inc a - .byte $1B - trb $3456 - ora $3456,x - asl $3456,x - bbr1 $12,*+122 - jsr $3456 - and ($12,x) - sax - st2 #$12 - bit $12 - and $12 - rol $12 - rmb2 $12 - plp - and #$12 - rol a - .byte $2B - bit $3456 - and $3456 - rol $3456 - bbr2 $12,*+122 - bmi *+122 - and ($12),y - and ($12) - .byte $33 - bit $12,x - and $12,x - rol $12,x - rmb3 $12 - sec - and $3456,y - dec a - .byte $3B - bit $3456,x - and $3456,x - rol $3456,x - bbr3 $12,*+122 - rti - eor ($12,x) - say - tma #$02 - bsr *+122 - eor $12 - lsr $12 - rmb4 $12 - pha - eor #$12 - lsr a - .byte $4B - jmp $3456 - eor $3456 - lsr $3456 - bbr4 $12,*+122 - bvc *+122 - eor ($12),y - eor ($12) - tam #$12 - csl - eor $12,x - lsr $12,x - rmb5 $12 - cli - eor $3456,y - phy - .byte $5B - .byte $5C - eor $3456,x - lsr $3456,x - bbr5 $12,*+122 - rts - adc ($12,x) - cla - .byte $63 - stz $12 - adc $12 - ror $12 - rmb6 $12 - pla - adc #$12 - ror a - .byte $6B - jmp ($3456) - adc $3456 - ror $3456 - bbr6 $12,*+122 - bvs *+122 - adc ($12),y - adc ($12) - tii $3333,$7373,$1111 - stz $12,x - adc $12,x - ror $12,x - rmb7 $12 - sei - adc $3456,y - ply - .byte $7B - jmp ($3456,x) - adc $3456,x - ror $3456,x - bbr7 $12,*+122 - bra *+122 - sta ($12,x) - clx - tst #$12,$EA - sty $12 - sta $12 - stx $12 - smb0 $12 - dey - bit #$12 - txa - .byte $8B - sty $3456 - sta $3456 - stx $3456 - bbs0 $12,*+122 - bcc *+122 - sta ($12),y - sta ($12) - tst #$12,$EAEA - sty $12,x - sta $12,x - stx $12,y - smb1 $12 - tya - sta $3456,y - txs - .byte $9B - stz $3456 - sta $3456,x - stz $3456,x - bbs1 $12,*+122 - ldy #$12 - lda ($12,x) - ldx #$12 - tst #$12,$EA,x - ldy $12 - lda $12 - ldx $12 - smb2 $12 - tay - lda #$12 - tax - .byte $AB - ldy $3456 - lda $3456 - ldx $3456 - bbs2 $12,*+122 - bcs *+122 - lda ($12),y - lda ($12) - tst #$12,$EAEA,x - ldy $12,x - lda $12,x - ldx $12,y - smb3 $12 - clv - lda $3456,y - tsx - .byte $BB - ldy $3456,x - lda $3456,x - ldx $3456,y - bbs3 $12,*+122 - cpy #$12 - cmp ($12,x) - cly - tdd $3333,$C3C3,$1111 - cpy $12 - cmp $12 - dec $12 - smb4 $12 - iny - cmp #$12 - dex - .byte $CB - cpy $3456 - cmp $3456 - dec $3456 - bbs4 $12,*+122 - bne *+122 - cmp ($12),y - cmp ($12) - tin $3333,$D3D3,$1111 - .byte $D4 - cmp $12,x - dec $12,x - smb5 $12 - cld - cmp $3456,y - phx - .byte $DB - .byte $DC - cmp $3456,x - dec $3456,x - bbs5 $12,*+122 - cpx #$12 - sbc ($12,x) - .byte $E2 - tia $3333,$E3E3,$1111 - cpx $12 - sbc $12 - inc $12 - smb6 $12 - inx - sbc #$12 - nop - .byte $EB - cpx $3456 - sbc $3456 - inc $3456 - bbs6 $12,*+122 - beq *+122 - sbc ($12),y - sbc ($12) - tai $3333,$F3F3,$1111 - .byte $F4 - sbc $12,x - inc $12,x - smb7 $12 - sed - sbc $3456,y - plx - .byte $FB - .byte $FC - sbc $3456,x - inc $3456,x - bbs7 $12,*+122 diff --git a/test/assembler/m740-opcodes.s b/test/assembler/m740-opcodes.s deleted file mode 100644 index df6d71488..000000000 --- a/test/assembler/m740-opcodes.s +++ /dev/null @@ -1,260 +0,0 @@ -.setcpu "65C02" -; copy of 65c02, comments note changes to the m740 according to -; http://documentation.renesas.com/doc/products/mpumcu/rej09b0322_740sm.pdf - - brk - ora ($12,x) - .byte $02,$00,$00 ; jsr zp,ind - .byte $03,$00,$00 ; bbs 0,a - tsb $12 ; .byte $04 - ora $12 - asl $12 - rmb0 $12 ; bbs 0,zp - php - ora #$12 - asl a - .byte $0B,$00,$00 ; seb 0,a - tsb $3456 ; .byte $0c - ora $3456 - asl $3456 - bbr0 $12,*+122 ; seb 0,zp - bpl *+122 - ora ($12),y - ora ($12) ; clt - .byte $13,$00,$00 ; bbc 0,a - trb $12 ; .byte $14 - ora $12,x - asl $12,x - rmb1 $12 ; bbc 0,zp - clc - ora $3456,y - inc a - .byte $1B,$00,$00 ; clb 0,a - trb $3456 ; .byte $1c - ora $3456,x - asl $3456,x - bbr1 $12,*+122 ; clb 0,zp - jsr $3456 - and ($12,x) - .byte $22,$00,$00 ; jsr sp - .byte $23,$00,$00 ; bbs 1,a - bit $12 - and $12 - rol $12 - rmb2 $12 ; bbs 1,zp - plp - and #$12 - rol a - .byte $2B,$00,$00 ; seb 1,a - bit $3456 - and $3456 - rol $3456 - bbr2 $12,*+122 ; seb 1,zp - bmi *+122 - and ($12),y - and ($12) ; set - .byte $33,$00,$00 ; bbc 1,a - bit $12,x ; .byte $34 - and $12,x - rol $12,x - rmb3 $12 ; bbc 1,zp - sec - and $3456,y - dec a - .byte $3B,$00,$00 ; clb 1,a - bit $3456,x ; ldm zp - and $3456,x - rol $3456,x - bbr3 $12,*+122 ; clb 1,zp - rti - eor ($12,x) - .byte $42,$00,$00 ; stp - .byte $43,$00,$00 ; bbs 2,a - .byte $44,$00,$00 ; com zp - eor $12 - lsr $12 - rmb4 $12 ; bbs 2,zp - pha - eor #$12 - lsr a - .byte $4B,$00,$00 ; seb 2,a - jmp $3456 - eor $3456 - lsr $3456 - bbr4 $12,*+122 ; seb 2,zp - bvc *+122 - eor ($12),y - eor ($12) ; .byte $52 - .byte $53,$00,$00 ; bbc 2,a - .byte $54,$00,$00 - eor $12,x - lsr $12,x - rmb5 $12 ; bbc 2,zp - cli - eor $3456,y - phy - .byte $5B,$00,$00 ; clb 2,a - .byte $5C,$00,$00 - eor $3456,x - lsr $3456,x - bbr5 $12,*+122 ; clb 2,zp - rts - adc ($12,x) - .byte $62,$00,$00 ; mul zp,x - .byte $63,$00,$00 ; bbs 3,a - stz $12 ; tst zp - adc $12 - ror $12 - rmb6 $12 ; bbs 3,zp - pla - adc #$12 - ror a - .byte $6B,$00,$00 ; seb 3,a - jmp ($3456) - adc $3456 - ror $3456 - bbr6 $12,*+122 ; seb 3,zp - bvs *+122 - adc ($12),y - adc ($12) ; .byte $72 - .byte $73,$00,$00 ; bbc 3,a - stz $12,x ; .byte $74 - adc $12,x - ror $12,x - rmb7 $12 ; bbc 3,zp - sei - adc $3456,y - ply - .byte $7B,$00,$00 ; clb 3,a - jmp ($3456,x) ; .byte $7c - adc $3456,x - ror $3456,x - bbr7 $12,*+122 ; clb 3,zp - bra *+122 - sta ($12,x) - .byte $82,$00,$00 ; rrf zp - .byte $83,$00,$00 ; bbs 4,a - sty $12 - sta $12 - stx $12 - smb0 $12 ; bbs 4,zp - dey - bit #$12 - txa - .byte $8B,$00,$00 ; seb 4,a - sty $3456 - sta $3456 - stx $3456 - bbs0 $12,*+122 ; seb 4,zp - bcc *+122 - sta ($12),y - sta ($12) ; .byte $92 - .byte $93,$00,$00 ; bbc 4,a - sty $12,x - sta $12,x - stx $12,y - smb1 $12 ; bbc 4,zp - tya - sta $3456,y - txs - .byte $9B,$00,$00 ; clb 4,a - stz $3456 ; .byte $9c - sta $3456,x - stz $3456,x ; .byte $9e - bbs1 $12,*+122 ; clb 4,zp - ldy #$12 - lda ($12,x) - ldx #$12 - .byte $A3,$00,$00 ; bbs 5,a - ldy $12 - lda $12 - ldx $12 - smb2 $12 ; bbs 5,zp - tay - lda #$12 - tax - .byte $AB,$00,$00 ; seb 5,a - ldy $3456 - lda $3456 - ldx $3456 - bbs2 $12,*+122 ; seb 5,zp - bcs *+122 - lda ($12),y - lda ($12) ; .byte $b2 - .byte $B3,$00,$00 ; bbc 5,a - ldy $12,x - lda $12,x - ldx $12,y - smb3 $12 ; bbc 5,zp - clv - lda $3456,y - tsx - .byte $BB,$00,$00 ; clb 5,a - ldy $3456,x - lda $3456,x - ldx $3456,y - bbs3 $12,*+122 ; clb 5,zp - cpy #$12 - cmp ($12,x) - .byte $C2,$00,$00 ; wit - .byte $C3,$00,$00 ; bbs 6,a - cpy $12 - cmp $12 - dec $12 - smb4 $12 ; bbs 6,zp - iny - cmp #$12 - dex - .byte $CB,$00,$00 ; seb 6,a - cpy $3456 - cmp $3456 - dec $3456 - bbs4 $12,*+122 ; seb 6,zp - bne *+122 - cmp ($12),y - cmp ($12) ; .byte $d2 - .byte $D3,$00,$00 ; bbc 6,a - .byte $D4,$00,$00 - cmp $12,x - dec $12,x - smb5 $12 ; bbc 6,zp - cld - cmp $3456,y - phx - .byte $DB,$00,$00 ; clb 6,a - .byte $DC,$00,$00 - cmp $3456,x - dec $3456,x - bbs5 $12,*+122 ; clb 6,zp - cpx #$12 - sbc ($12,x) - .byte $E2,$00,$00 ; div zp,x - .byte $E3,$00,$00 ; bbs 7,a - cpx $12 - sbc $12 - inc $12 - smb6 $12 ; bbs 7,zp - inx - sbc #$12 - nop - .byte $EB,$00,$00 ; seb 7,a - cpx $3456 - sbc $3456 - inc $3456 - bbs6 $12,*+122 ; seb 7,zp - beq *+122 - sbc ($12),y - sbc ($12) ; .byte $f2 - .byte $F3,$00,$00 ; bbc 7,a - .byte $F4,$00,$00 - sbc $12,x - inc $12,x - smb7 $12 ; bbc 7,zp - sed - sbc $3456,y - plx - .byte $FB,$00,$00 ; clb 7,a - .byte $FC,$00,$00 - sbc $3456,x - inc $3456,x - bbs7 $12,*+122 ; clb 7,zp diff --git a/test/dasm/4510-disass.s b/test/dasm/4510-disass.s new file mode 100644 index 000000000..96ed6419d --- /dev/null +++ b/test/dasm/4510-disass.s @@ -0,0 +1,298 @@ +.setcpu "4510" + +ZP = $12 +ABS = $2345 + +start: + brk + ora (ZP,x) + cle + see + tsb ZP + ora ZP + asl ZP + rmb0 ZP + php + ora #$01 + asl + tsy + tsb ABS + ora ABS + asl ABS + bbr0 ZP,label1 + +label1: + bpl label2 + ora (ZP),y + ora (ZP),z + lbpl start ; bpl start + trb ZP + ora ZP,x + asl ZP,x + rmb1 ZP + clc + ora ABS,y + inc + inz + trb ABS + ora ABS,x + asl ABS,x + bbr1 ZP,label2 + +label2: + jsr ABS + and (ZP,x) + jsr ($2345) + jsr ($2456,x) + bit ZP + and ZP + rol ZP + rmb2 ZP + plp + and #$01 + rol + tys + bit ABS + and ABS + rol ABS + bbr2 ZP,label3 + +label3: + bmi label4 + and (ZP),y + and (ZP),z + lbmi start ; bmi start + bit ZP,x + and ZP,x + rol ZP,x + rmb3 ZP + sec + and ABS,y + dec + dez + bit ABS,x + and ABS,x + rol ABS,x + bbr3 ZP,label4 + +label4: + rti + eor (ZP,x) + neg + asr + asr ZP + eor ZP + lsr ZP + rmb4 ZP + pha + eor #$01 + lsr + taz + jmp ABS + eor ABS + lsr ABS + bbr4 ZP,label5 + +label5: + bvc label6 + eor (ZP),y + eor (ZP),z + lbvc start ; bvc start + asr ZP,x + eor ZP,x + lsr ZP,x + rmb5 ZP + cli + eor ABS,y + phy + tab + map + eor ABS,x + lsr ABS,x + bbr5 ZP,label6 + +label6: + rts + adc (ZP,x) + rtn #$09 + bsr start + stz ZP + adc ZP + ror ZP + rmb6 ZP + pla + adc #$01 + ror + tza + jmp ($2345) + adc ABS + ror ABS + bbr6 ZP,label7 + +label7: + bvs label8 + adc (ZP),y + adc (ZP),z + lbvs start ; bvs start + stz ZP,x + adc ZP,x + ror ZP,x + rmb7 ZP + sei + adc ABS,y + ply + tba + jmp ($2456,x) + adc ABS,x + ror ABS,x + bbr7 ZP,label8 + +label8: + bra label9 + sta (ZP,x) + sta ($0f,sp),y + lbra start ; bra start + sty ZP + sta ZP + stx ZP + smb0 ZP + dey + bit #$01 + txa + sty ABS,x + sty ABS + sta ABS + stx ABS + bbs0 ZP,label9 + +label9: + bcc labelA + sta (ZP),y + sta (ZP),z + lbcc start ; bcc start + sty ZP,x + sta ZP,x + stx ZP,y + smb1 ZP + tya + sta ABS,y + txs + stx ABS,y + stz ABS + sta ABS,x + stz ABS,x + bbs1 ZP,labelA + +labelA: + ldy #$01 + lda (ZP,x) + ldx #$01 + ldz #$01 + ldy ZP + lda ZP + ldx ZP + smb2 ZP + tay + lda #$01 + tax + ldz ABS + ldy ABS + lda ABS + ldx ABS + bbs2 ZP,labelB + +labelB: + bcs labelC + lda (ZP),y + lda (ZP),z + lbcs start ; bcs start + ldy ZP,x + lda ZP,x + ldx ZP,y + smb3 ZP + clv + lda ABS,y + tsx + ldz ABS,x + ldy ABS,x + lda ABS,x + ldx ABS,y + bbs3 ZP,labelC + +labelC: + cpy #$01 + cmp (ZP,x) + cpz #$01 + dew ZP + cpy ZP + cmp ZP + dec ZP + smb4 ZP + iny + cmp #$01 + dex + asw ABS + cpy ABS + cmp ABS + dec ABS + bbs4 ZP,labelD + +labelD: + bne labelE + cmp (ZP),y + cmp (ZP),z + lbne start ; bne start + cpz ZP + cmp ZP,x + dec ZP,x + smb5 ZP + cld + cmp ABS,y + phx + phz + cpz ABS + cmp ABS,x + dec ABS,x + bbs5 ZP,labelE + +labelE: + cpx #$01 + sbc (ZP,x) + lda ($0f,sp),y + inw ZP + cpx ZP + sbc ZP + inc ZP + smb6 ZP + inx + sbc #$01 + eom + nop + row ABS + cpx ABS + sbc ABS + inc ABS + bbs6 ZP,labelF + +labelF: + beq labelG + sbc (ZP),y + sbc (ZP),z + lbeq start ; beq start + phw #$089a + sbc ZP,x + inc ZP,x + smb7 ZP + sed + sbc ABS,y + plx + plz + phd ABS + phw ABS + sbc ABS,x + inc ABS,x + bbs7 ZP,labelG + +labelG: + brk + diff --git a/test/dasm/Makefile b/test/dasm/Makefile new file mode 100644 index 000000000..f8942ef73 --- /dev/null +++ b/test/dasm/Makefile @@ -0,0 +1,64 @@ +# Makefile for the disassembler regression tests + +ifneq ($(shell echo),) + CMD_EXE = 1 +endif + +ifdef CMD_EXE + EXE = .exe + MKDIR = mkdir $(subst /,\,$1) + RMDIR = -rmdir /s /q $(subst /,\,$1) + DEL = del /f $(subst /,\,$1) +else + EXE = + MKDIR = mkdir -p $1 + RMDIR = $(RM) -r $1 + DEL = $(RM) $1 +endif + +CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65) +DA65 := $(if $(wildcard ../../bin/da65*),../../bin/da65,da65) + +WORKDIR = ../../testwrk/dasm + +DIFF = $(WORKDIR)/bdiff$(EXE) + +CC = gcc +CFLAGS = -O2 + +START = --start-addr 0x8000 + +.PHONY: all clean + +SOURCES := $(wildcard *.s) +CPUS = $(foreach src,$(SOURCES),$(src:%-disass.s=%)) +BINS = $(foreach cpu,$(CPUS),$(WORKDIR)/$(cpu)-reass.bin) + +# default target defined later +all: $(BINS) + +$(WORKDIR): + $(call MKDIR,$(WORKDIR)) + +$(DIFF): ../bdiff.c | $(WORKDIR) + $(CC) $(CFLAGS) -o $@ $< + +define DISASS_template + +$(WORKDIR)/$1-disass.bin: $1-disass.s | $(WORKDIR) + $(CL65) --cpu $1 -t none $(START) -o $$@ $$< + +$(WORKDIR)/$1-reass.s: $(WORKDIR)/$1-disass.bin + $(DA65) --cpu $1 $(START) -o $$@ $$< + +$(WORKDIR)/$1-reass.bin: $(WORKDIR)/$1-reass.s $(DIFF) + $(CL65) --cpu $1 -t none $(START) -o $$@ $$< + $(DIFF) $$@ $(WORKDIR)/$1-disass.bin + +endef # DISASS_template + +$(foreach cpu,$(CPUS),$(eval $(call DISASS_template,$(cpu)))) + +clean: + @$(call RMDIR,$(WORKDIR)) + @$(call DEL,$(SOURCES:.s=.o)) diff --git a/test/disassembler/4510-disass.s b/test/disassembler/4510-disass.s deleted file mode 100644 index 96ed6419d..000000000 --- a/test/disassembler/4510-disass.s +++ /dev/null @@ -1,298 +0,0 @@ -.setcpu "4510" - -ZP = $12 -ABS = $2345 - -start: - brk - ora (ZP,x) - cle - see - tsb ZP - ora ZP - asl ZP - rmb0 ZP - php - ora #$01 - asl - tsy - tsb ABS - ora ABS - asl ABS - bbr0 ZP,label1 - -label1: - bpl label2 - ora (ZP),y - ora (ZP),z - lbpl start ; bpl start - trb ZP - ora ZP,x - asl ZP,x - rmb1 ZP - clc - ora ABS,y - inc - inz - trb ABS - ora ABS,x - asl ABS,x - bbr1 ZP,label2 - -label2: - jsr ABS - and (ZP,x) - jsr ($2345) - jsr ($2456,x) - bit ZP - and ZP - rol ZP - rmb2 ZP - plp - and #$01 - rol - tys - bit ABS - and ABS - rol ABS - bbr2 ZP,label3 - -label3: - bmi label4 - and (ZP),y - and (ZP),z - lbmi start ; bmi start - bit ZP,x - and ZP,x - rol ZP,x - rmb3 ZP - sec - and ABS,y - dec - dez - bit ABS,x - and ABS,x - rol ABS,x - bbr3 ZP,label4 - -label4: - rti - eor (ZP,x) - neg - asr - asr ZP - eor ZP - lsr ZP - rmb4 ZP - pha - eor #$01 - lsr - taz - jmp ABS - eor ABS - lsr ABS - bbr4 ZP,label5 - -label5: - bvc label6 - eor (ZP),y - eor (ZP),z - lbvc start ; bvc start - asr ZP,x - eor ZP,x - lsr ZP,x - rmb5 ZP - cli - eor ABS,y - phy - tab - map - eor ABS,x - lsr ABS,x - bbr5 ZP,label6 - -label6: - rts - adc (ZP,x) - rtn #$09 - bsr start - stz ZP - adc ZP - ror ZP - rmb6 ZP - pla - adc #$01 - ror - tza - jmp ($2345) - adc ABS - ror ABS - bbr6 ZP,label7 - -label7: - bvs label8 - adc (ZP),y - adc (ZP),z - lbvs start ; bvs start - stz ZP,x - adc ZP,x - ror ZP,x - rmb7 ZP - sei - adc ABS,y - ply - tba - jmp ($2456,x) - adc ABS,x - ror ABS,x - bbr7 ZP,label8 - -label8: - bra label9 - sta (ZP,x) - sta ($0f,sp),y - lbra start ; bra start - sty ZP - sta ZP - stx ZP - smb0 ZP - dey - bit #$01 - txa - sty ABS,x - sty ABS - sta ABS - stx ABS - bbs0 ZP,label9 - -label9: - bcc labelA - sta (ZP),y - sta (ZP),z - lbcc start ; bcc start - sty ZP,x - sta ZP,x - stx ZP,y - smb1 ZP - tya - sta ABS,y - txs - stx ABS,y - stz ABS - sta ABS,x - stz ABS,x - bbs1 ZP,labelA - -labelA: - ldy #$01 - lda (ZP,x) - ldx #$01 - ldz #$01 - ldy ZP - lda ZP - ldx ZP - smb2 ZP - tay - lda #$01 - tax - ldz ABS - ldy ABS - lda ABS - ldx ABS - bbs2 ZP,labelB - -labelB: - bcs labelC - lda (ZP),y - lda (ZP),z - lbcs start ; bcs start - ldy ZP,x - lda ZP,x - ldx ZP,y - smb3 ZP - clv - lda ABS,y - tsx - ldz ABS,x - ldy ABS,x - lda ABS,x - ldx ABS,y - bbs3 ZP,labelC - -labelC: - cpy #$01 - cmp (ZP,x) - cpz #$01 - dew ZP - cpy ZP - cmp ZP - dec ZP - smb4 ZP - iny - cmp #$01 - dex - asw ABS - cpy ABS - cmp ABS - dec ABS - bbs4 ZP,labelD - -labelD: - bne labelE - cmp (ZP),y - cmp (ZP),z - lbne start ; bne start - cpz ZP - cmp ZP,x - dec ZP,x - smb5 ZP - cld - cmp ABS,y - phx - phz - cpz ABS - cmp ABS,x - dec ABS,x - bbs5 ZP,labelE - -labelE: - cpx #$01 - sbc (ZP,x) - lda ($0f,sp),y - inw ZP - cpx ZP - sbc ZP - inc ZP - smb6 ZP - inx - sbc #$01 - eom - nop - row ABS - cpx ABS - sbc ABS - inc ABS - bbs6 ZP,labelF - -labelF: - beq labelG - sbc (ZP),y - sbc (ZP),z - lbeq start ; beq start - phw #$089a - sbc ZP,x - inc ZP,x - smb7 ZP - sed - sbc ABS,y - plx - plz - phd ABS - phw ABS - sbc ABS,x - inc ABS,x - bbs7 ZP,labelG - -labelG: - brk - diff --git a/test/disassembler/Makefile b/test/disassembler/Makefile deleted file mode 100644 index f8942ef73..000000000 --- a/test/disassembler/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# Makefile for the disassembler regression tests - -ifneq ($(shell echo),) - CMD_EXE = 1 -endif - -ifdef CMD_EXE - EXE = .exe - MKDIR = mkdir $(subst /,\,$1) - RMDIR = -rmdir /s /q $(subst /,\,$1) - DEL = del /f $(subst /,\,$1) -else - EXE = - MKDIR = mkdir -p $1 - RMDIR = $(RM) -r $1 - DEL = $(RM) $1 -endif - -CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65) -DA65 := $(if $(wildcard ../../bin/da65*),../../bin/da65,da65) - -WORKDIR = ../../testwrk/dasm - -DIFF = $(WORKDIR)/bdiff$(EXE) - -CC = gcc -CFLAGS = -O2 - -START = --start-addr 0x8000 - -.PHONY: all clean - -SOURCES := $(wildcard *.s) -CPUS = $(foreach src,$(SOURCES),$(src:%-disass.s=%)) -BINS = $(foreach cpu,$(CPUS),$(WORKDIR)/$(cpu)-reass.bin) - -# default target defined later -all: $(BINS) - -$(WORKDIR): - $(call MKDIR,$(WORKDIR)) - -$(DIFF): ../bdiff.c | $(WORKDIR) - $(CC) $(CFLAGS) -o $@ $< - -define DISASS_template - -$(WORKDIR)/$1-disass.bin: $1-disass.s | $(WORKDIR) - $(CL65) --cpu $1 -t none $(START) -o $$@ $$< - -$(WORKDIR)/$1-reass.s: $(WORKDIR)/$1-disass.bin - $(DA65) --cpu $1 $(START) -o $$@ $$< - -$(WORKDIR)/$1-reass.bin: $(WORKDIR)/$1-reass.s $(DIFF) - $(CL65) --cpu $1 -t none $(START) -o $$@ $$< - $(DIFF) $$@ $(WORKDIR)/$1-disass.bin - -endef # DISASS_template - -$(foreach cpu,$(CPUS),$(eval $(call DISASS_template,$(cpu)))) - -clean: - @$(call RMDIR,$(WORKDIR)) - @$(call DEL,$(SOURCES:.s=.o))