Debian Codegraph @

docs/cputypes/all.txt

raw
1
2
3 ACME
4
5 ...the ACME Crossassembler for Multiple Environments
6
7 --- cpu types ---
8
9
10 ACME supports the following cpu types (shown here as a sort of family
11 tree):
12
13 6502 standard
14 |
15 |\_nmos6502 (=6510) + undocumented opcodes
16 |
17 |\_c64dtv2 + BRA/SAC/SIR and some (not all!) undocumented
18 |
19 \_65c02 + BRA/PHX/PHY/PLX/PLY/STZ/TRB/TSB/...
20 |
21 |\_65816 16 bit regs, 24 bit address space, ...
22 |
23 \_r65c02 + bit manipulation instructions
24 |
25 |\_w65c02 + STP/WAI
26 |
27 \_65ce02 + Z reg, long branches, ...
28 |
29 \_4502 + MAP/EOM
30 |
31 \_m65 + 32-bit pointers, 32-bit 'Q' register
32
33
34
35 !cpu 6502
36
37 This is the official instruction set of the original NMOS 6502 CPU
38 designed by MOS (later CSG).
39 There are 151 documented opcodes.
40 ACME does not use "A" to indicate "accumulator addressing"; just write
41 the mnemonic without any argument: "LSR" will work, "LSR A" won't.
42
43
44
45 !cpu nmos6502
46
47 This instruction set includes the undocumented ("illegal") opcodes of
48 the NMOS 6502.
49 See "docs/Illegals.txt" for more info.
50
51
52
53 !cpu 6510
54
55 This is an alias for "nmos6502", because the 6510 cpu (as used in the
56 C64 computer) is a variant of this type.
57
58
59
60 !cpu c64dtv2
61
62 This is the cpu in version 2 of the C64DTV. It uses a superset of the
63 6502 instruction set. Features:
64 - new instructions:
65 BRA near_target branch always
66 SAC #$12 set accumulator mapping
67 SIR #$12 set index register mapping
68 - support for some (but not all!) of the undocumented opcodes.
69
70
71
72 !cpu 65c02
73
74 This is the CMOS re-design of the 6502. It seems to have also been
75 available from Rockwell, GTE/CMD and others. Features:
76 - new instructions:
77 BRA near_target branch always
78 PHX/PHY/PLX/PLY push/pull X/Y register
79 STZ $12 store zero in zp
80 STZ $12, x store zero in zp, x-indexed
81 STZ $1234 store zero absolute
82 STZ $1234, x store zero absolute, x-indexed
83 TRB $12 test and reset bits in zp
84 TRB $1234 test and reset bits absolute
85 TSB $12 test and set bits in zp
86 TSB $1234 test and set bits absolute
87 - new addressing modes for existing instructions:
88 LDA/STA/ADC/SBC ($12) zp indirect
89 AND/ORA/EOR/CMP ($12) zp indirect
90 BIT #$12 immediate
91 BIT $12, x zp, x-indexed
92 BIT $1234, x absolute, x-indexed
93 INC increment accumulator
94 DEC decrement accumulator
95 JMP ($1234, x) x-indexed indirect
96 - bugfix for flags in decimal mode
97 - bugfix for JMP($xxff) instruction
98 - undocumented opcodes are NOPs (although of different lengths)
99 There are 178 documented opcodes.
100
101
102
103 !cpu 65816
104
105 This is a superset of 65c02, originally designed by WDC (it seems to
106 have been available from GTE/CMD as well). Features:
107 - register sizes can be changed to 16-bit
108 - 24-bit address space
109 - several new instructions (including block transfers)
110 - several new addressing modes for existing instructions
111 There are 256 documented opcodes, but one of them ("WDM") is reserved
112 for future expansion.
113 See "docs/65816.txt" for more info.
114
115
116
117 !cpu r65c02
118
119 This is a superset of 65c02, probably originally by Rockwell. It adds
120 bit manipulation instructions:
121 BBR4 $12, near_target branch on bit reset in zp
122 BBS5 $12, near_target branch on bit set in zp
123 RMB6 $12 reset memory bit in zp
124 SMB7 $12 set memory bit in zp
125 The digit in the mnemonic is the bit number, therefore it must be in
126 the 0..7 range.
127 Chips with this instruction set seem to have been available from
128 Rockwell, GTE/CMD and others.
129 There are 210 documented opcodes.
130
131
132
133 !cpu w65c02
134
135 This is a superset of r65c02, originating at WDC. It adds two new
136 instructions:
137 STP stop (wait for reset)
138 WAI wait for interrupt
139 There are 212 documented opcodes.
140
141
142
143 !cpu 65ce02
144
145 This is a superset of r65c02, originating at CSG. Features:
146 - Z register
147 - 16-bit stack pointer
148 - 16-bit branches
149 - new instructions (including a few 16-bit operations)
150 - new addressing modes for existing instructions
151 There is a known bug: SBC does not work correctly in decimal mode.
152 There are 256 documented opcodes, but one of them ("AUG") is reserved
153 for future expansion.
154 ACME uses different mnemonics for old and new (long) branch
155 instructions:
156 BEQ near_target old, 8-bit offset
157 LBEQ far_target new, 16-bit offset
158 The original datasheet called BRA ("branch always") BRU ("branch
159 unconditional") instead. ACME accepts both mnemonics.
160
161
162
163 !cpu 4502
164
165 This is basically the same as 65ce02, but
166 - MAP replaces AUG
167 - EOM is synonymous to NOP
168 This cpu core can be found in the CSG4510 chip in the C65.
169 There are 256 documented opcodes.
170
171
172
173 !cpu m65
174
175 This is a superset of 4502 specified by the MEGA65 project. It uses
176 NEG:NEG and NOP as prefix bytes to extend the instruction set.
177 Features:
178 - "quad mode" (32-bit data operations on virtual register 'Q')
179 - "long mode" (32-bit pointer addressing for existing mnemonics)
180 - "quad" and "long" modes can be combined
181
182 "quad" mode introduces several new mnemonics:
183 LDQ/STQ/CPQ like LDA/STA/CMP
184 ADCQ/SBCQ like ADC/SBC
185 ANDQ/EORQ/ORQ like AND/EOR/ORA
186 ASLQ/LSRQ/ROLQ/RORQ like ASL/LSR/ROL/ROR
187 INQ/DEQ like INC/DEC
188 BITQ like BIT
189 ASRQ like ASR
190 The new mnemonics support most of the addressing modes of the
191 original mnemonics with these exceptions:
192 - there is no immediate addressing
193 - indirect-Z-indexed addressing becomes indirect addressing,
194 except for LDQ.
195 - all other indexed addressing modes can only really be used
196 with read-modify-write instructions, because otherwise a part
197 of the 'Q' value would be used as the index.
198 CAUTION: The STQ instruction clobbers the N and Z flags!
199 There is no "real" Q register, instead A/X/Y/Z are combined to form
200 the Q register (A holds lsb, Z holds msb), except for read-modify-
201 write instructions, where the 32-bit operation is performed without
202 using A/X/Y/Z.
203 To load a 32-bit immediate constant into the Q register, use the
204 +movq macro from the <m65/std.a> library file.
205
206 "long" mode brings a single new addressing mode for eight mnemonics:
207 LDA [$12], z contents of $12/$13/$14/$15
208 STA [$12], z plus z form the address
209 CMP [$12], z
210 ADC [$12], z
211 SBC [$12], z
212 AND [$12], z
213 EOR [$12], z
214 ORA [$12], z
215
216 "quad" and "long" modes combined result in another addressing mode for
217 eight of the new mnemonics:
218 LDQ [$12], z contents of $12/$13/$14/$15
219 STQ [$12] form the address
220 CPQ [$12]
221 ADCQ [$12]
222 SBCQ [$12]
223 ANDQ [$12]
224 EORQ [$12]
225 ORQ [$12]
226
227 The NOP mnemonic is disabled for this instruction set because its
228 opcode is re-used internally as a prefix byte.
229 CAUTION: The !align pseudo opcode still inserts NOPs.