snes_utils 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mini_assembler +10 -0
- data/lib/mini_assembler/definitions.rb +1 -333
- data/lib/mini_assembler/mini_assembler.rb +203 -54
- data/lib/mini_assembler/spc700/definitions.rb +470 -0
- data/lib/mini_assembler/wdc65816/definitions.rb +344 -0
- data/lib/snes_utils.rb +2 -0
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10a0fc18707cb4e615a13c7ed398cd65eb5b8f87a58ef96ad354b7448fb6ee8c
|
4
|
+
data.tar.gz: 6d99ea9bfb1d5a96e4d4fbb9a9389d05999ee834cd236d9ae8ac1e9d05b65f46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6b26360469e26d8af4e90abb38935a25ec1be30788331f5b051566b3a02fd834e32bf5bc14c06760cdf43a694e454215f5f6d6d0fdc6e999ba56b313d120d21
|
7
|
+
data.tar.gz: b53fd68058fa91144cf7123154fa4ab1cdbdde1d7d10d5a48600b8b16d17510924e45696dabf1ab21cf92babd6e4422ced446ac8f6f0950b656e5da8dbf3e90f
|
data/bin/mini_assembler
CHANGED
@@ -5,6 +5,16 @@ require 'snes_utils'
|
|
5
5
|
|
6
6
|
options = {}
|
7
7
|
OptionParser.new do |opts|
|
8
|
+
opts.on("-h", "--help", "Prints this help") do
|
9
|
+
puts opts
|
10
|
+
exit
|
11
|
+
end
|
12
|
+
|
13
|
+
opts.on('-a', '--assemble FILENAME', 'ASM file') do |option|
|
14
|
+
puts SnesUtils::MiniAssembler.new().assemble_file(option)
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
|
8
18
|
opts.on('-f', '--file FILENAME', 'ROM file') { |o| options[:filename] = o }
|
9
19
|
end.parse!
|
10
20
|
|
@@ -1,39 +1,6 @@
|
|
1
1
|
module SnesUtils
|
2
2
|
class Definitions
|
3
3
|
HEX_DIGIT = '[0-9a-f]'
|
4
|
-
HEX8 = "\\$?(#{HEX_DIGIT}{1,2})"
|
5
|
-
HEX16 = "\\$?(#{HEX_DIGIT}{3,4})"
|
6
|
-
HEX24 = "\\$?(#{HEX_DIGIT}{5,6})"
|
7
|
-
|
8
|
-
MODES_REGEXES = {
|
9
|
-
acc: /^$/,
|
10
|
-
imp: /^$/,
|
11
|
-
imm: /^#{HEX8}$/i,
|
12
|
-
iml: /^#{HEX16}$/i,
|
13
|
-
imm8: /^##{HEX8}$/i,
|
14
|
-
imm16: /^##{HEX16}$/i,
|
15
|
-
sr: /^#{HEX8},S$/i,
|
16
|
-
dp: /^#{HEX8}$/i,
|
17
|
-
dpx: /^#{HEX8},X$/i,
|
18
|
-
dpy: /^#{HEX8},Y$/i,
|
19
|
-
idp: /^\(#{HEX8}\)$/i,
|
20
|
-
idx: /^\(#{HEX8},X\)$/i,
|
21
|
-
idy: /^\(#{HEX8}\),Y$/i,
|
22
|
-
idl: /^\[#{HEX8}\]$/i,
|
23
|
-
idly: /^\[#{HEX8}\],Y$/i,
|
24
|
-
isy: /^\(#{HEX8},S\),Y$/i,
|
25
|
-
abs: /^#{HEX16}$/i,
|
26
|
-
abx: /^#{HEX16},X$/i,
|
27
|
-
aby: /^#{HEX16},Y$/i,
|
28
|
-
abl: /^#{HEX24}$/i,
|
29
|
-
alx: /^#{HEX24},X$/i,
|
30
|
-
ind: /^\(#{HEX16}\)$/i,
|
31
|
-
iax: /^\(#{HEX16},X\)$/i,
|
32
|
-
ial: /^\[#{HEX16}\]$/i,
|
33
|
-
rel: /^#{HEX16}$/i,
|
34
|
-
rell: /^#{HEX16}$/i,
|
35
|
-
bm: /^#{HEX8},#{HEX8}$/i
|
36
|
-
}
|
37
4
|
|
38
5
|
BYTE_LOC_REGEX = /^#{HEX_DIGIT}{1,4}$/i
|
39
6
|
BYTE_RANGE_REGEX = /^(#{HEX_DIGIT}{1,4})\.+(#{HEX_DIGIT}{1,4})$/i
|
@@ -43,305 +10,6 @@ module SnesUtils
|
|
43
10
|
FLIP_MX_REG_REGEX = /^([01])=([xm])$/i
|
44
11
|
WRITE_REGEX = /^\.write\s*(.*)$/i
|
45
12
|
INCBIN_REGEX = /^(#{HEX_DIGIT}{1,4}):\s*\.incbin\s+(.*)$/i
|
46
|
-
READ_REGEX =
|
47
|
-
|
48
|
-
MODES_FORMATS = {
|
49
|
-
acc: "%s",
|
50
|
-
imp: "%s",
|
51
|
-
imm: "%s #%02X",
|
52
|
-
iml: "%s %02X",
|
53
|
-
imm8: "%s #%02X",
|
54
|
-
imm16: "%s #%04X",
|
55
|
-
sr: "%s #%02X,S",
|
56
|
-
dp: "%s %02X",
|
57
|
-
dpx: "%s %02X,X",
|
58
|
-
dpy: "%s %02X,Y",
|
59
|
-
idp: "%s (%02X)",
|
60
|
-
idx: "%s (%02X,X)",
|
61
|
-
idy: "%s (%02X),Y",
|
62
|
-
idl: "%s [%02X]",
|
63
|
-
idly: "%s [%02X],Y",
|
64
|
-
isy: "%s (%02X,S),Y",
|
65
|
-
abs: "%s %04X",
|
66
|
-
abx: "%s %04X,X",
|
67
|
-
aby: "%s %04X,Y",
|
68
|
-
abl: "%s %06x",
|
69
|
-
alx: "%s %06x,X",
|
70
|
-
ind: "%s (%04X)",
|
71
|
-
iax: "%s (%04X,X)",
|
72
|
-
ial: "%s [%04X]",
|
73
|
-
rel: "%s %04X {%s}",
|
74
|
-
rell: "%s %04X {%s}",
|
75
|
-
bm: "%s %02X,%02X"
|
76
|
-
}
|
77
|
-
|
78
|
-
OPCODES_DATA = [{ opcode: 0x61, mnemonic: 'ADC', mode: :idx, length: 2 },
|
79
|
-
{ opcode: 0x63, mnemonic: 'ADC', mode: :sr, length: 2 },
|
80
|
-
{ opcode: 0x65, mnemonic: 'ADC', mode: :dp, length: 2 },
|
81
|
-
{ opcode: 0x67, mnemonic: 'ADC', mode: :idl, length: 2 },
|
82
|
-
{ opcode: 0x69, mnemonic: 'ADC', mode: :imm8, length: 2, m: 1 },
|
83
|
-
{ opcode: 0x69, mnemonic: 'ADC', mode: :imm16, length: 3, m: 0 },
|
84
|
-
{ opcode: 0x6d, mnemonic: 'ADC', mode: :abs, length: 3 },
|
85
|
-
{ opcode: 0x6f, mnemonic: 'ADC', mode: :abl, length: 4 },
|
86
|
-
{ opcode: 0x71, mnemonic: 'ADC', mode: :idy, length: 2 },
|
87
|
-
{ opcode: 0x72, mnemonic: 'ADC', mode: :idp, length: 2 },
|
88
|
-
{ opcode: 0x73, mnemonic: 'ADC', mode: :isy, length: 2 },
|
89
|
-
{ opcode: 0x75, mnemonic: 'ADC', mode: :dpx, length: 2 },
|
90
|
-
{ opcode: 0x77, mnemonic: 'ADC', mode: :idly, length: 2 },
|
91
|
-
{ opcode: 0x79, mnemonic: 'ADC', mode: :aby, length: 3 },
|
92
|
-
{ opcode: 0x7d, mnemonic: 'ADC', mode: :abx, length: 3 },
|
93
|
-
{ opcode: 0x7f, mnemonic: 'ADC', mode: :alx, length: 4 },
|
94
|
-
{ opcode: 0xe1, mnemonic: 'SBC', mode: :idx, length: 2 },
|
95
|
-
{ opcode: 0xe3, mnemonic: 'SBC', mode: :sr, length: 2 },
|
96
|
-
{ opcode: 0xe5, mnemonic: 'SBC', mode: :dp, length: 2 },
|
97
|
-
{ opcode: 0xe7, mnemonic: 'SBC', mode: :idl, length: 2 },
|
98
|
-
{ opcode: 0xe9, mnemonic: 'SBC', mode: :imm8, length: 2, m: 1 },
|
99
|
-
{ opcode: 0xe9, mnemonic: 'SBC', mode: :imm16, length: 3, m: 0 },
|
100
|
-
{ opcode: 0xed, mnemonic: 'SBC', mode: :abs, length: 3 },
|
101
|
-
{ opcode: 0xef, mnemonic: 'SBC', mode: :abl, length: 4 },
|
102
|
-
{ opcode: 0xf1, mnemonic: 'SBC', mode: :idy, length: 2 },
|
103
|
-
{ opcode: 0xf2, mnemonic: 'SBC', mode: :idp, length: 2 },
|
104
|
-
{ opcode: 0xf3, mnemonic: 'SBC', mode: :isy, length: 2 },
|
105
|
-
{ opcode: 0xf5, mnemonic: 'SBC', mode: :dpx, length: 2 },
|
106
|
-
{ opcode: 0xf7, mnemonic: 'SBC', mode: :idly, length: 2 },
|
107
|
-
{ opcode: 0xf9, mnemonic: 'SBC', mode: :aby, length: 3 },
|
108
|
-
{ opcode: 0xfd, mnemonic: 'SBC', mode: :abx, length: 3 },
|
109
|
-
{ opcode: 0xff, mnemonic: 'SBC', mode: :alx, length: 4 },
|
110
|
-
{ opcode: 0xc1, mnemonic: 'CMP', mode: :idx, length: 2 },
|
111
|
-
{ opcode: 0xc3, mnemonic: 'CMP', mode: :sr, length: 2 },
|
112
|
-
{ opcode: 0xc5, mnemonic: 'CMP', mode: :dp, length: 2 },
|
113
|
-
{ opcode: 0xc7, mnemonic: 'CMP', mode: :idl, length: 2 },
|
114
|
-
{ opcode: 0xc9, mnemonic: 'CMP', mode: :imm8, length: 2, m: 1 },
|
115
|
-
{ opcode: 0xc9, mnemonic: 'CMP', mode: :imm16, length: 3, m: 0 },
|
116
|
-
{ opcode: 0xcd, mnemonic: 'CMP', mode: :abs, length: 3 },
|
117
|
-
{ opcode: 0xcf, mnemonic: 'CMP', mode: :abl, length: 4 },
|
118
|
-
{ opcode: 0xd1, mnemonic: 'CMP', mode: :idy, length: 2 },
|
119
|
-
{ opcode: 0xd2, mnemonic: 'CMP', mode: :idp, length: 2 },
|
120
|
-
{ opcode: 0xd3, mnemonic: 'CMP', mode: :isy, length: 2 },
|
121
|
-
{ opcode: 0xd5, mnemonic: 'CMP', mode: :dpx, length: 2 },
|
122
|
-
{ opcode: 0xd7, mnemonic: 'CMP', mode: :idly, length: 2 },
|
123
|
-
{ opcode: 0xd9, mnemonic: 'CMP', mode: :aby, length: 3 },
|
124
|
-
{ opcode: 0xdd, mnemonic: 'CMP', mode: :abx, length: 3 },
|
125
|
-
{ opcode: 0xdf, mnemonic: 'CMP', mode: :alx, length: 4 },
|
126
|
-
{ opcode: 0xe0, mnemonic: 'CPX', mode: :imm8, length: 2, x: 1 },
|
127
|
-
{ opcode: 0xe0, mnemonic: 'CPX', mode: :imm16, length: 3, x: 0 },
|
128
|
-
{ opcode: 0xe4, mnemonic: 'CPX', mode: :dp, length: 2 },
|
129
|
-
{ opcode: 0xec, mnemonic: 'CPX', mode: :abs, length: 3 },
|
130
|
-
{ opcode: 0xc0, mnemonic: 'CPY', mode: :imm8, length: 2, x: 1 },
|
131
|
-
{ opcode: 0xc0, mnemonic: 'CPY', mode: :imm16, length: 3, x: 0 },
|
132
|
-
{ opcode: 0xc4, mnemonic: 'CPY', mode: :dp, length: 2 },
|
133
|
-
{ opcode: 0xcc, mnemonic: 'CPY', mode: :abs, length: 3 },
|
134
|
-
{ opcode: 0x3a, mnemonic: 'DEC', mode: :acc, length: 1 },
|
135
|
-
{ opcode: 0xc6, mnemonic: 'DEC', mode: :dp, length: 2 },
|
136
|
-
{ opcode: 0xce, mnemonic: 'DEC', mode: :abs, length: 3 },
|
137
|
-
{ opcode: 0xd6, mnemonic: 'DEC', mode: :dpx, length: 2 },
|
138
|
-
{ opcode: 0xde, mnemonic: 'DEC', mode: :abx, length: 3 },
|
139
|
-
{ opcode: 0xca, mnemonic: 'DEX', mode: :imp, length: 1 },
|
140
|
-
{ opcode: 0x88, mnemonic: 'DEY', mode: :imp, length: 1 },
|
141
|
-
{ opcode: 0x1a, mnemonic: 'INC', mode: :acc, length: 1 },
|
142
|
-
{ opcode: 0xe6, mnemonic: 'INC', mode: :dp, length: 2 },
|
143
|
-
{ opcode: 0xee, mnemonic: 'INC', mode: :abs, length: 3 },
|
144
|
-
{ opcode: 0xf6, mnemonic: 'INC', mode: :dpx, length: 2 },
|
145
|
-
{ opcode: 0xfe, mnemonic: 'INC', mode: :abx, length: 3 },
|
146
|
-
{ opcode: 0xe8, mnemonic: 'INX', mode: :imp, length: 1 },
|
147
|
-
{ opcode: 0xc8, mnemonic: 'INY', mode: :imp, length: 1 },
|
148
|
-
{ opcode: 0x21, mnemonic: 'AND', mode: :idx, length: 2 },
|
149
|
-
{ opcode: 0x23, mnemonic: 'AND', mode: :sr, length: 2 },
|
150
|
-
{ opcode: 0x25, mnemonic: 'AND', mode: :dp, length: 2 },
|
151
|
-
{ opcode: 0x27, mnemonic: 'AND', mode: :idl, length: 2 },
|
152
|
-
{ opcode: 0x29, mnemonic: 'AND', mode: :imm8, length: 2, m: 1 },
|
153
|
-
{ opcode: 0x29, mnemonic: 'AND', mode: :imm16, length: 3, m: 0 },
|
154
|
-
{ opcode: 0x2d, mnemonic: 'AND', mode: :abs, length: 3 },
|
155
|
-
{ opcode: 0x2f, mnemonic: 'AND', mode: :abl, length: 4 },
|
156
|
-
{ opcode: 0x31, mnemonic: 'AND', mode: :idy, length: 2 },
|
157
|
-
{ opcode: 0x32, mnemonic: 'AND', mode: :idp, length: 2 },
|
158
|
-
{ opcode: 0x33, mnemonic: 'AND', mode: :isy, length: 2 },
|
159
|
-
{ opcode: 0x35, mnemonic: 'AND', mode: :dpx, length: 2 },
|
160
|
-
{ opcode: 0x37, mnemonic: 'AND', mode: :idly, length: 2 },
|
161
|
-
{ opcode: 0x39, mnemonic: 'AND', mode: :aby, length: 3 },
|
162
|
-
{ opcode: 0x3d, mnemonic: 'AND', mode: :abx, length: 3 },
|
163
|
-
{ opcode: 0x3f, mnemonic: 'AND', mode: :alx, length: 4 },
|
164
|
-
{ opcode: 0x41, mnemonic: 'EOR', mode: :idx, length: 2 },
|
165
|
-
{ opcode: 0x43, mnemonic: 'EOR', mode: :sr, length: 2 },
|
166
|
-
{ opcode: 0x45, mnemonic: 'EOR', mode: :dp, length: 2 },
|
167
|
-
{ opcode: 0x47, mnemonic: 'EOR', mode: :idl, length: 2 },
|
168
|
-
{ opcode: 0x49, mnemonic: 'EOR', mode: :imm8, length: 2, m: 1 },
|
169
|
-
{ opcode: 0x49, mnemonic: 'EOR', mode: :imm16, length: 3, m: 0 },
|
170
|
-
{ opcode: 0x4d, mnemonic: 'EOR', mode: :abs, length: 3 },
|
171
|
-
{ opcode: 0x4f, mnemonic: 'EOR', mode: :abl, length: 4 },
|
172
|
-
{ opcode: 0x51, mnemonic: 'EOR', mode: :idy, length: 2 },
|
173
|
-
{ opcode: 0x52, mnemonic: 'EOR', mode: :idp, length: 2 },
|
174
|
-
{ opcode: 0x53, mnemonic: 'EOR', mode: :isy, length: 2 },
|
175
|
-
{ opcode: 0x55, mnemonic: 'EOR', mode: :dpx, length: 2 },
|
176
|
-
{ opcode: 0x57, mnemonic: 'EOR', mode: :idly, length: 2 },
|
177
|
-
{ opcode: 0x59, mnemonic: 'EOR', mode: :aby, length: 3 },
|
178
|
-
{ opcode: 0x5d, mnemonic: 'EOR', mode: :abx, length: 3 },
|
179
|
-
{ opcode: 0x5f, mnemonic: 'EOR', mode: :alx, length: 4 },
|
180
|
-
{ opcode: 0x01, mnemonic: 'ORA', mode: :idx, length: 2 },
|
181
|
-
{ opcode: 0x03, mnemonic: 'ORA', mode: :sr, length: 2 },
|
182
|
-
{ opcode: 0x05, mnemonic: 'ORA', mode: :dp, length: 2 },
|
183
|
-
{ opcode: 0x07, mnemonic: 'ORA', mode: :idl, length: 2 },
|
184
|
-
{ opcode: 0x09, mnemonic: 'ORA', mode: :imm8, length: 2, m: 1 },
|
185
|
-
{ opcode: 0x09, mnemonic: 'ORA', mode: :imm16, length: 3, m: 0 },
|
186
|
-
{ opcode: 0x0d, mnemonic: 'ORA', mode: :abs, length: 3 },
|
187
|
-
{ opcode: 0x0f, mnemonic: 'ORA', mode: :abl, length: 4 },
|
188
|
-
{ opcode: 0x11, mnemonic: 'ORA', mode: :idy, length: 2 },
|
189
|
-
{ opcode: 0x12, mnemonic: 'ORA', mode: :idp, length: 2 },
|
190
|
-
{ opcode: 0x13, mnemonic: 'ORA', mode: :isy, length: 2 },
|
191
|
-
{ opcode: 0x15, mnemonic: 'ORA', mode: :dpx, length: 2 },
|
192
|
-
{ opcode: 0x17, mnemonic: 'ORA', mode: :idly, length: 2 },
|
193
|
-
{ opcode: 0x19, mnemonic: 'ORA', mode: :aby, length: 3 },
|
194
|
-
{ opcode: 0x1d, mnemonic: 'ORA', mode: :abx, length: 3 },
|
195
|
-
{ opcode: 0x1f, mnemonic: 'ORA', mode: :alx, length: 4 },
|
196
|
-
{ opcode: 0x24, mnemonic: 'BIT', mode: :dp, length: 2 },
|
197
|
-
{ opcode: 0x2c, mnemonic: 'BIT', mode: :abs, length: 3 },
|
198
|
-
{ opcode: 0x34, mnemonic: 'BIT', mode: :dpx, length: 2 },
|
199
|
-
{ opcode: 0x3c, mnemonic: 'BIT', mode: :abx, length: 3 },
|
200
|
-
{ opcode: 0x89, mnemonic: 'BIT', mode: :imm8, length: 2, m: 1 },
|
201
|
-
{ opcode: 0x89, mnemonic: 'BIT', mode: :imm16, length: 3, m: 0 },
|
202
|
-
{ opcode: 0x14, mnemonic: 'TRB', mode: :dp, length: 2 },
|
203
|
-
{ opcode: 0x1c, mnemonic: 'TRB', mode: :abs, length: 3 },
|
204
|
-
{ opcode: 0x04, mnemonic: 'TSB', mode: :dp, length: 2 },
|
205
|
-
{ opcode: 0x0c, mnemonic: 'TSB', mode: :abs, length: 3 },
|
206
|
-
{ opcode: 0x06, mnemonic: 'ASL', mode: :dp, length: 2 },
|
207
|
-
{ opcode: 0x0a, mnemonic: 'ASL', mode: :acc, length: 1 },
|
208
|
-
{ opcode: 0x0e, mnemonic: 'ASL', mode: :abs, length: 3 },
|
209
|
-
{ opcode: 0x16, mnemonic: 'ASL', mode: :dpx, length: 2 },
|
210
|
-
{ opcode: 0x1e, mnemonic: 'ASL', mode: :abx, length: 3 },
|
211
|
-
{ opcode: 0x46, mnemonic: 'LSR', mode: :dp, length: 2 },
|
212
|
-
{ opcode: 0x4a, mnemonic: 'LSR', mode: :acc, length: 1 },
|
213
|
-
{ opcode: 0x4e, mnemonic: 'LSR', mode: :abs, length: 3 },
|
214
|
-
{ opcode: 0x56, mnemonic: 'LSR', mode: :dpx, length: 2 },
|
215
|
-
{ opcode: 0x5e, mnemonic: 'LSR', mode: :abx, length: 3 },
|
216
|
-
{ opcode: 0x26, mnemonic: 'ROL', mode: :dp, length: 2 },
|
217
|
-
{ opcode: 0x2a, mnemonic: 'ROL', mode: :acc, length: 1 },
|
218
|
-
{ opcode: 0x2e, mnemonic: 'ROL', mode: :abs, length: 3 },
|
219
|
-
{ opcode: 0x36, mnemonic: 'ROL', mode: :dpx, length: 2 },
|
220
|
-
{ opcode: 0x3e, mnemonic: 'ROL', mode: :abx, length: 3 },
|
221
|
-
{ opcode: 0x66, mnemonic: 'ROR', mode: :dp, length: 2 },
|
222
|
-
{ opcode: 0x6a, mnemonic: 'ROR', mode: :acc, length: 1 },
|
223
|
-
{ opcode: 0x6e, mnemonic: 'ROR', mode: :abs, length: 3 },
|
224
|
-
{ opcode: 0x76, mnemonic: 'ROR', mode: :dpx, length: 2 },
|
225
|
-
{ opcode: 0x7e, mnemonic: 'ROR', mode: :abx, length: 3 },
|
226
|
-
{ opcode: 0x90, mnemonic: 'BCC', mode: :rel, length: 2 },
|
227
|
-
{ opcode: 0xb0, mnemonic: 'BCS', mode: :rel, length: 2 },
|
228
|
-
{ opcode: 0xf0, mnemonic: 'BEQ', mode: :rel, length: 2 },
|
229
|
-
{ opcode: 0x30, mnemonic: 'BMI', mode: :rel, length: 2 },
|
230
|
-
{ opcode: 0xd0, mnemonic: 'BNE', mode: :rel, length: 2 },
|
231
|
-
{ opcode: 0x10, mnemonic: 'BPL', mode: :rel, length: 2 },
|
232
|
-
{ opcode: 0x80, mnemonic: 'BRA', mode: :rel, length: 2 },
|
233
|
-
{ opcode: 0x50, mnemonic: 'BVC', mode: :rel, length: 2 },
|
234
|
-
{ opcode: 0x70, mnemonic: 'BVS', mode: :rel, length: 2 },
|
235
|
-
{ opcode: 0x82, mnemonic: 'BRL', mode: :rell, length: 3 },
|
236
|
-
{ opcode: 0x4c, mnemonic: 'JMP', mode: :abs, length: 3 },
|
237
|
-
{ opcode: 0x5c, mnemonic: 'JMP', mode: :abl, length: 4 },
|
238
|
-
{ opcode: 0x6c, mnemonic: 'JMP', mode: :ind, length: 3 },
|
239
|
-
{ opcode: 0x7c, mnemonic: 'JMP', mode: :iax, length: 3 },
|
240
|
-
{ opcode: 0xdc, mnemonic: 'JMP', mode: :ial, length: 3 },
|
241
|
-
{ opcode: 0x22, mnemonic: 'JSL', mode: :abl, length: 4 },
|
242
|
-
{ opcode: 0x20, mnemonic: 'JSR', mode: :abs, length: 3 },
|
243
|
-
{ opcode: 0xfc, mnemonic: 'JSR', mode: :iax, length: 3 },
|
244
|
-
{ opcode: 0x6b, mnemonic: 'RTL', mode: :imp, length: 1 },
|
245
|
-
{ opcode: 0x60, mnemonic: 'RTS', mode: :imp, length: 1 },
|
246
|
-
{ opcode: 0x00, mnemonic: 'BRK', mode: :imm, length: 2 },
|
247
|
-
{ opcode: 0x02, mnemonic: 'COP', mode: :imm, length: 2 },
|
248
|
-
{ opcode: 0x40, mnemonic: 'RTI', mode: :imp, length: 1 },
|
249
|
-
{ opcode: 0x18, mnemonic: 'CLC', mode: :imp, length: 1 },
|
250
|
-
{ opcode: 0xd8, mnemonic: 'CLD', mode: :imp, length: 1 },
|
251
|
-
{ opcode: 0x58, mnemonic: 'CLI', mode: :imp, length: 1 },
|
252
|
-
{ opcode: 0xb8, mnemonic: 'CLV', mode: :imp, length: 1 },
|
253
|
-
{ opcode: 0x38, mnemonic: 'SEC', mode: :imp, length: 1 },
|
254
|
-
{ opcode: 0xf8, mnemonic: 'SED', mode: :imp, length: 1 },
|
255
|
-
{ opcode: 0x78, mnemonic: 'SEI', mode: :imp, length: 1 },
|
256
|
-
{ opcode: 0xc2, mnemonic: 'REP', mode: :imm8, length: 2 },
|
257
|
-
{ opcode: 0xe2, mnemonic: 'SEP', mode: :imm8, length: 2 },
|
258
|
-
{ opcode: 0xa1, mnemonic: 'LDA', mode: :idx, length: 2 },
|
259
|
-
{ opcode: 0xa3, mnemonic: 'LDA', mode: :sr, length: 2 },
|
260
|
-
{ opcode: 0xa5, mnemonic: 'LDA', mode: :dp, length: 2 },
|
261
|
-
{ opcode: 0xa7, mnemonic: 'LDA', mode: :idl, length: 2 },
|
262
|
-
{ opcode: 0xa9, mnemonic: 'LDA', mode: :imm8, length: 2, m: 1 },
|
263
|
-
{ opcode: 0xa9, mnemonic: 'LDA', mode: :imm16, length: 3, m: 0 },
|
264
|
-
{ opcode: 0xad, mnemonic: 'LDA', mode: :abs, length: 3 },
|
265
|
-
{ opcode: 0xaf, mnemonic: 'LDA', mode: :abl, length: 4 },
|
266
|
-
{ opcode: 0xb1, mnemonic: 'LDA', mode: :idy, length: 2 },
|
267
|
-
{ opcode: 0xb2, mnemonic: 'LDA', mode: :idp, length: 2 },
|
268
|
-
{ opcode: 0xb3, mnemonic: 'LDA', mode: :isy, length: 2 },
|
269
|
-
{ opcode: 0xb5, mnemonic: 'LDA', mode: :dpx, length: 2 },
|
270
|
-
{ opcode: 0xb7, mnemonic: 'LDA', mode: :idly, length: 2 },
|
271
|
-
{ opcode: 0xb9, mnemonic: 'LDA', mode: :aby, length: 3 },
|
272
|
-
{ opcode: 0xbd, mnemonic: 'LDA', mode: :abx, length: 3 },
|
273
|
-
{ opcode: 0xbf, mnemonic: 'LDA', mode: :alx, length: 4 },
|
274
|
-
{ opcode: 0xa2, mnemonic: 'LDX', mode: :imm8, length: 2, x: 1 },
|
275
|
-
{ opcode: 0xa2, mnemonic: 'LDX', mode: :imm16, length: 3, x: 0 },
|
276
|
-
{ opcode: 0xa6, mnemonic: 'LDX', mode: :dp, length: 2 },
|
277
|
-
{ opcode: 0xae, mnemonic: 'LDX', mode: :abs, length: 3 },
|
278
|
-
{ opcode: 0xb6, mnemonic: 'LDX', mode: :dpy, length: 2 },
|
279
|
-
{ opcode: 0xbe, mnemonic: 'LDX', mode: :aby, length: 3 },
|
280
|
-
{ opcode: 0xa0, mnemonic: 'LDY', mode: :imm8, length: 2, x: 1 },
|
281
|
-
{ opcode: 0xa0, mnemonic: 'LDY', mode: :imm16, length: 3, x: 0 },
|
282
|
-
{ opcode: 0xa4, mnemonic: 'LDY', mode: :dp, length: 2 },
|
283
|
-
{ opcode: 0xac, mnemonic: 'LDY', mode: :abs, length: 3 },
|
284
|
-
{ opcode: 0xb4, mnemonic: 'LDY', mode: :dpx, length: 2 },
|
285
|
-
{ opcode: 0xbc, mnemonic: 'LDY', mode: :abx, length: 3 },
|
286
|
-
{ opcode: 0x81, mnemonic: 'STA', mode: :idx, length: 2 },
|
287
|
-
{ opcode: 0x83, mnemonic: 'STA', mode: :sr, length: 2 },
|
288
|
-
{ opcode: 0x85, mnemonic: 'STA', mode: :dp, length: 2 },
|
289
|
-
{ opcode: 0x87, mnemonic: 'STA', mode: :idl, length: 2 },
|
290
|
-
{ opcode: 0x8d, mnemonic: 'STA', mode: :abs, length: 3 },
|
291
|
-
{ opcode: 0x8f, mnemonic: 'STA', mode: :abl, length: 4 },
|
292
|
-
{ opcode: 0x91, mnemonic: 'STA', mode: :idy, length: 2 },
|
293
|
-
{ opcode: 0x92, mnemonic: 'STA', mode: :idp, length: 2 },
|
294
|
-
{ opcode: 0x93, mnemonic: 'STA', mode: :isy, length: 2 },
|
295
|
-
{ opcode: 0x95, mnemonic: 'STA', mode: :dpx, length: 2 },
|
296
|
-
{ opcode: 0x97, mnemonic: 'STA', mode: :idly, length: 2 },
|
297
|
-
{ opcode: 0x99, mnemonic: 'STA', mode: :aby, length: 3 },
|
298
|
-
{ opcode: 0x9d, mnemonic: 'STA', mode: :abx, length: 3 },
|
299
|
-
{ opcode: 0x9f, mnemonic: 'STA', mode: :alx, length: 4 },
|
300
|
-
{ opcode: 0x86, mnemonic: 'STX', mode: :dp, length: 2 },
|
301
|
-
{ opcode: 0x8e, mnemonic: 'STX', mode: :abs, length: 3 },
|
302
|
-
{ opcode: 0x96, mnemonic: 'STX', mode: :dpy, length: 2 },
|
303
|
-
{ opcode: 0x84, mnemonic: 'STY', mode: :dp, length: 2 },
|
304
|
-
{ opcode: 0x8c, mnemonic: 'STY', mode: :abs, length: 3 },
|
305
|
-
{ opcode: 0x94, mnemonic: 'STY', mode: :dpx, length: 2 },
|
306
|
-
{ opcode: 0x64, mnemonic: 'STZ', mode: :dp, length: 2 },
|
307
|
-
{ opcode: 0x74, mnemonic: 'STZ', mode: :dpx, length: 2 },
|
308
|
-
{ opcode: 0x9c, mnemonic: 'STZ', mode: :abs, length: 3 },
|
309
|
-
{ opcode: 0x9e, mnemonic: 'STZ', mode: :abx, length: 3 },
|
310
|
-
{ opcode: 0x54, mnemonic: 'MVN', mode: :bm, length: 3 },
|
311
|
-
{ opcode: 0x44, mnemonic: 'MVP', mode: :bm, length: 3 },
|
312
|
-
{ opcode: 0xea, mnemonic: 'NOP', mode: :imp, length: 1 },
|
313
|
-
{ opcode: 0x42, mnemonic: 'WDM', mode: :imm, length: 2 },
|
314
|
-
{ opcode: 0xf4, mnemonic: 'PEA', mode: :iml, length: 3 },
|
315
|
-
{ opcode: 0xd4, mnemonic: 'PEI', mode: :dp, length: 2 },
|
316
|
-
{ opcode: 0x62, mnemonic: 'PER', mode: :rell, length: 3 },
|
317
|
-
{ opcode: 0x48, mnemonic: 'PHA', mode: :imp, length: 1 },
|
318
|
-
{ opcode: 0xda, mnemonic: 'PHX', mode: :imp, length: 1 },
|
319
|
-
{ opcode: 0x5a, mnemonic: 'PHY', mode: :imp, length: 1 },
|
320
|
-
{ opcode: 0x68, mnemonic: 'PLA', mode: :imp, length: 1 },
|
321
|
-
{ opcode: 0xfa, mnemonic: 'PLX', mode: :imp, length: 1 },
|
322
|
-
{ opcode: 0x7a, mnemonic: 'PLY', mode: :imp, length: 1 },
|
323
|
-
{ opcode: 0x8b, mnemonic: 'PHB', mode: :imp, length: 1 },
|
324
|
-
{ opcode: 0x0b, mnemonic: 'PHD', mode: :imp, length: 1 },
|
325
|
-
{ opcode: 0x4b, mnemonic: 'PHK', mode: :imp, length: 1 },
|
326
|
-
{ opcode: 0x08, mnemonic: 'PHP', mode: :imp, length: 1 },
|
327
|
-
{ opcode: 0xab, mnemonic: 'PLB', mode: :imp, length: 1 },
|
328
|
-
{ opcode: 0x2b, mnemonic: 'PLD', mode: :imp, length: 1 },
|
329
|
-
{ opcode: 0x28, mnemonic: 'PLP', mode: :imp, length: 1 },
|
330
|
-
{ opcode: 0xdb, mnemonic: 'STP', mode: :imp, length: 1 },
|
331
|
-
{ opcode: 0xcb, mnemonic: 'WAI', mode: :imp, length: 1 },
|
332
|
-
{ opcode: 0xaa, mnemonic: 'TAX', mode: :imp, length: 1 },
|
333
|
-
{ opcode: 0xa8, mnemonic: 'TAY', mode: :imp, length: 1 },
|
334
|
-
{ opcode: 0xba, mnemonic: 'TSX', mode: :imp, length: 1 },
|
335
|
-
{ opcode: 0x8a, mnemonic: 'TXA', mode: :imp, length: 1 },
|
336
|
-
{ opcode: 0x9a, mnemonic: 'TXS', mode: :imp, length: 1 },
|
337
|
-
{ opcode: 0x9b, mnemonic: 'TXY', mode: :imp, length: 1 },
|
338
|
-
{ opcode: 0x98, mnemonic: 'TYA', mode: :imp, length: 1 },
|
339
|
-
{ opcode: 0xbb, mnemonic: 'TYX', mode: :imp, length: 1 },
|
340
|
-
{ opcode: 0x5b, mnemonic: 'TCD', mode: :imp, length: 1 },
|
341
|
-
{ opcode: 0x1b, mnemonic: 'TCS', mode: :imp, length: 1 },
|
342
|
-
{ opcode: 0x7b, mnemonic: 'TDC', mode: :imp, length: 1 },
|
343
|
-
{ opcode: 0x3b, mnemonic: 'TSC', mode: :imp, length: 1 },
|
344
|
-
{ opcode: 0xeb, mnemonic: 'XBA', mode: :imp, length: 1 },
|
345
|
-
{ opcode: 0xfb, mnemonic: 'XCE', mode: :imp, length: 1 }].freeze
|
13
|
+
READ_REGEX = /^((#{HEX_DIGIT}{1,4}):\s*)*\.read\s+(.*)$/i
|
346
14
|
end
|
347
15
|
end
|