diff --git a/testing/cpus/std.a b/testing/cpus/std.a new file mode 100644 index 0000000..c9726fa --- /dev/null +++ b/testing/cpus/std.a @@ -0,0 +1,153 @@ +;ACME 0.97 + ; all the standard 6502 instructions: + brk ; 00 + ora ($01, x) ; 01 + ora $05 ; 05 + asl $05 ; 06 + php ; 08 + ora #$09 ; 09 + asl ; 0a + ora $0d0e ; 0d + asl $0d0e ; 0e + bpl * + 2 ; 10 + ora ($11), y ; 11 + ora $15, x ; 15 + asl $15, x ; 16 + clc ; 18 + ora $1919, y ; 19 + ora $1d1e, x ; 1d + asl $1d1e, x ; 1e + jsr $0d0e ; 20 + and ($01, x) ; 21 + bit $05 ; 24 + and $05 ; 25 + rol $05 ; 26 + plp ; 28 + and #$09 ; 29 + rol ; 2a + bit $0d0e ; 2c + and $0d0e ; 2d + rol $0d0e ; 2e + bmi * + 2 ; 30 + and ($11), y ; 31 + and $15, x ; 35 + rol $15, x ; 36 + sec ; 38 + and $1919, y ; 39 + and $1d1e, x ; 3d + rol $1d1e, x ; 3e + rti ; 40 + eor ($01, x) ; 41 + eor $05 ; 45 + lsr $05 ; 46 + pha ; 48 + eor #$09 ; 49 + lsr ; 4a + jmp $0d0e ; 4c + eor $0d0e ; 4d + lsr $0d0e ; 4e + bvc * + 2 ; 50 + eor ($11), y ; 51 + eor $15, x ; 55 + lsr $15, x ; 56 + cli ; 58 + eor $1919, y ; 59 + eor $1d1e, x ; 5d + lsr $1d1e, x ; 5e + rts ; 60 + adc ($01, x) ; 61 + adc $05 ; 65 + ror $05 ; 66 + pla ; 68 + adc #$09 ; 69 + ror ; 6a + jmp ($6c6c) ; 6c + adc $0d0e ; 6d + ror $0d0e ; 6e + bvs * + 2 ; 70 + adc ($11), y ; 71 + adc $15, x ; 75 + ror $15, x ; 76 + sei ; 78 + adc $1919, y ; 79 + adc $1d1e, x ; 7d + ror $1d1e, x ; 7e + sta ($01, x) ; 81 + sty $05 ; 84 + sta $05 ; 85 + stx $05 ; 86 + dey ; 88 + txa ; 8a + sty $0d0e ; 8c + sta $0d0e ; 8d + stx $0d0e ; 8e + bcc * + 2 ; 90 + sta ($11), y ; 91 + sty $15, x ; 94 + sta $15, x ; 95 + stx $96, y ; 96 + tya ; 98 + sta $1919, y ; 99 + txs ; 9a + sta $1d1e, x ; 9d + ldy #$09 ; a0 + lda ($01, x) ; a1 + ldx #$09 ; a2 + ldy $05 ; a4 + lda $05 ; a5 + ldx $05 ; a6 + tay ; a8 + lda #$09 ; a9 + tax ; aa + ldy $0d0e ; ac + lda $0d0e ; ad + ldx $0d0e ; ae + bcs * + 2 ; b0 + lda ($11), y ; b1 + ldy $15, x ; b4 + lda $15, x ; b5 + ldx $96, y ; b6 + clv ; b8 + lda $1919, y ; b9 + tsx ; ba + ldy $1d1e, x ; bc + lda $1d1e, x ; bd + ldx $1919, y ; be + cpy #$09 ; c0 + cmp ($01, x) ; c1 + cpy $05 ; c4 + cmp $05 ; c5 + dec $05 ; c6 + iny ; c8 + cmp #$09 ; c9 + dex ; ca + cpy $0d0e ; cc + cmp $0d0e ; cd + dec $0d0e ; ce + bne * + 2 ; d0 + cmp ($11), y ; d1 + cmp $15, x ; d5 + dec $15, x ; d6 + cld ; d8 + cmp $1919, y ; d9 + cmp $1d1e, x ; dd + dec $1d1e, x ; de + cpx #$09 ; e0 + sbc ($01, x) ; e1 + cpx $05 ; e4 + sbc $05 ; e5 + inc $05 ; e6 + inx ; e8 + sbc #$09 ; e9 + nop ; ea + cpx $0d0e ; ec + sbc $0d0e ; ed + inc $0d0e ; ee + beq * + 2 ; f0 + sbc ($11), y ; f1 + sbc $15, x ; f5 + inc $15, x ; f6 + sed ; f8 + sbc $1919, y ; f9 + sbc $1d1e, x ; fd + inc $1d1e, x ; fe diff --git a/testing/cpus/test-6502.a b/testing/cpus/test-6502.a new file mode 100644 index 0000000..3ac4c09 --- /dev/null +++ b/testing/cpus/test-6502.a @@ -0,0 +1,5 @@ +;ACME 0.97 + !cpu 6502 + !to "out-6502.o", plain + *=$1000 + !src "std.a" diff --git a/testing/cpus/test-nmos6502.a b/testing/cpus/test-nmos6502.a new file mode 100644 index 0000000..619d1e0 --- /dev/null +++ b/testing/cpus/test-nmos6502.a @@ -0,0 +1,76 @@ +;ACME 0.97 + !cpu nmos6502 + !to "out-nmos6502.o", plain + *=$1000 + !src "std.a" +; nmos6502 additions: + jam ; 02 + slo ($03, x) ; 03 + nop $04 ; 04 + slo $04 ; 07 + anc #$0b ; 0b + nop $0c0f ; 0c + slo $0c0f ; 0f + slo ($13), y ; 13 + nop $14, x ; 14 + slo $14, x ; 17 + slo $1b1b, y ; 1b + nop $1c1f, x ; 1c + slo $1c1f, x ; 1f + rla ($03, x) ; 23 + rla $04 ; 27 + rla $0c0f ; 2f + rla ($13), y ; 33 + rla $14, x ; 37 + rla $1b1b, y ; 3b + rla $1c1f, x ; 3f + sre ($03, x) ; 43 + sre $04 ; 47 + asr #$0b ; 4b + sre $0c0f ; 4f + sre ($13), y ; 53 + sre $14, x ; 57 + sre $1b1b, y ; 5b + sre $1c1f, x ; 5f + rra ($03, x) ; 63 + rra $04 ; 67 + arr #$0b ; 6b + rra $0c0f ; 6f + rra ($13), y ; 73 + rra $14, x ; 77 + rra $1b1b, y ; 7b + rra $1c1f, x ; 7f + nop #$0b ; 80 + sax ($03, x) ; 83 + sax $04 ; 87 + ane #0 ; 8b (anything non-zero gives a warning) + sax $0c0f ; 8f + sha ($13), y ; 93 + sax $97, y ; 97 + tas $1b1b, y ; 9b + shy $1c1f, x ; 9c + shx $1b1b, y ; 9e + sha $1b1b, y ; 9f + lax ($03, x) ; a3 + lax $04 ; a7 + lxa #0 ; ab (anything non-zero gives a warning) + lax $0c0f ; af + lax ($13), y ; b3 + lax $97, y ; b7 + las $1b1b, y ; bb + lax $1b1b, y ; bf + dcp ($03, x) ; c3 + dcp $04 ; c7 + sbx #$0b ; cb + dcp $0c0f ; cf + dcp ($13), y ; d3 + dcp $14, x ; d7 + dcp $1b1b, y ; db + dcp $1c1f, x ; df + isc ($03, x) ; e3 + isc $04 ; e7 + isc $0c0f ; ef + isc ($13), y ; f3 + isc $14, x ; f7 + isc $1b1b, y ; fb + isc $1c1f, x ; ff diff --git a/testing/warnings/binlen.a b/testing/warnings/binlen.a new file mode 100644 index 0000000..86a5f3e --- /dev/null +++ b/testing/warnings/binlen.a @@ -0,0 +1,4 @@ +;ACME 0.97 + a = %........ ; eight digits + a = %....... + a = %.........