Debian Codegraph @

testing/cpus/test-65816.a

raw
1 ;ACME 0.97
2 !cpu 65816
3 !to "out-65816.o", plain
4 *=$1000
5 !src "include-6502.a"
6 !src "include-65c02.a"
7 ; !src "include-bitmanips.a" 65816 does not support these
8
9 ; new instructions of 65816:
10 cop $02 ; 02
11 ora $03, s ; 03
12 ora [$07] ; 07
13 phd ; 0b
14 ora $0f0f0f ; 0f
15 ora ($13, s), y ; 13
16 ora [$17], y ; 17
17 tcs ; 1b
18 ora $1f1f1f, x ; 1f
19 jsr $0f0f0f ; 22
20 and $03, s ; 23
21 and [$07] ; 27
22 pld ; 2b
23 and $0f0f0f ; 2f
24 and ($13, s), y ; 33
25 and [$17], y ; 37
26 tsc ; 3b
27 and $1f1f1f, x ; 3f
28 wdm ; 42
29 eor $03, s ; 43
30 mvp $44, $54 ; 44
31 eor [$07] ; 47
32 phk ; 4b
33 eor $0f0f0f ; 4f
34 eor ($13, s), y ; 53
35 mvn $44, $54 ; 54
36 eor [$17], y ; 57
37 tcd ; 5b
38 jmp $0f0f0f ; 5c
39 eor $1f1f1f, x ; 5f
40 per * + 3 ; 62
41 adc $03, s ; 63
42 adc [$07] ; 67
43 rtl ; 6b
44 adc $0f0f0f ; 6f
45 adc ($13, s), y ; 73
46 adc [$17], y ; 77
47 tdc ; 7b
48 adc $1f1f1f, x ; 7f
49 brl * + 3 ; 82
50 sta $03, s ; 83
51 sta [$07] ; 87
52 phb ; 8b
53 sta $0f0f0f ; 8f
54 sta ($13, s), y ; 93
55 sta [$17], y ; 97
56 txy ; 9b
57 sta $1f1f1f, x ; 9f
58 lda $03, s ; a3
59 lda [$07] ; a7
60 plb ; ab
61 lda $0f0f0f ; af
62 lda ($13, s), y ; b3
63 lda [$17], y ; b7
64 tyx ; bb
65 lda $1f1f1f, x ; bf
66 rep #$c2 ; c2, see below
67 cmp $03, s ; c3
68 cmp [$07] ; c7
69 wai ; cb
70 cmp $0f0f0f ; cf
71 cmp ($13, s), y ; d3
72 pei ($d4) ; d4
73 cmp [$17], y ; d7
74 stp ; db
75 jmp [$dcdc] ; dc
76 cmp $1f1f1f, x ; df
77 sep #$e2 ; e2, see below
78 sbc $03, s ; e3
79 sbc [$07] ; e7
80 xba ; eb
81 sbc $0f0f0f ; ef
82 sbc ($13, s), y ; f3
83 pea $f4f4 ; f4
84 sbc [$17], y ; f7
85 xce ; fb
86 jsr ($fcfc, x) ; fc
87 sbc $1f1f1f, x ; ff
88
89 ; check sizes of immediate arguments:
90 !macro immediates {
91 ; arg size depends on:
92 ; from 6502:
93 ora #$09 ; 09 accumulator size
94 and #$09 ; 29 accumulator size
95 eor #$09 ; 49 accumulator size
96 adc #$09 ; 69 accumulator size
97 ldy #$09 ; a0 index register size
98 ldx #$09 ; a2 index register size
99 lda #$09 ; a9 accumulator size
100 cpy #$09 ; c0 index register size
101 cmp #$09 ; c9 accumulator size
102 cpx #$09 ; e0 index register size
103 sbc #$09 ; e9 accumulator size
104 ; from 65c02:
105 bit #$89 ; 89 accumulator size
106 ; from 65816:
107 rep #$c2 ; c2 always 8 bits
108 sep #$e2 ; e2 always 8 bits
109 }
110 ; before this, all sizes were 8 bits
111 !al
112 +immediates ; now repeat immediates with long accumulator
113 !as
114 !rl
115 +immediates ; repeat immediates with short A and long index regs
116 !al
117 !rl
118 +immediates ; repeat immediates with long A and long index regs