fixes vor ADC/SBC & added byte-ode for ADC/SBC
This commit is contained in:
parent
97aafc5815
commit
640643cb65
1 changed files with 16 additions and 10 deletions
12
PDP11/test.c
12
PDP11/test.c
|
@ -325,19 +325,25 @@ void emit_add_sub_c()
|
||||||
int id = 0;
|
int id = 0;
|
||||||
json_t *out = json_array();
|
json_t *out = json_array();
|
||||||
for(int group=0; group<4; group++) {
|
for(int group=0; group<4; group++) {
|
||||||
|
for(int word=0; word<2; word++) {
|
||||||
uint16_t instr = 0;
|
uint16_t instr = 0;
|
||||||
int word = group & 1;
|
|
||||||
|
|
||||||
if (group == 0 || group == 1)
|
if (group == 0 || group == 1)
|
||||||
instr = (6 << 12 /* instr */) | (word << 15 /* ADD/SUB */) | (1 << 6 /* src=R1 */);
|
instr = (6 << 12 /* instr */) | (word << 15 /* ADD/SUB */) | (1 << 6 /* src=R1 */);
|
||||||
else if (group == 2)
|
else if (group == 2)
|
||||||
instr = (055 << 6 /* instr */) | (word << 15 /* ADCb/ADCw */) | (1 << 6 /* src=R1 */);
|
instr = (055 << 6 /* instr */) | (word << 15 /* ADCb/ADCw */) | 1 /* src=R1 */;
|
||||||
else if (group == 3)
|
else if (group == 3)
|
||||||
instr = (056 << 6 /* instr */) | (word << 15 /* SBCb/SBCw */) | (1 << 6 /* src=R1 */);
|
instr = (056 << 6 /* instr */) | (word << 15 /* SBCb/SBCw */) | 1 /* src=R1 */;
|
||||||
|
|
||||||
|
if (group == 2 || group == 3) {
|
||||||
for(int psw_val=0; psw_val<2; psw_val++)
|
for(int psw_val=0; psw_val<2; psw_val++)
|
||||||
produce_set_register(instr, psw_val, &id, out);
|
produce_set_register(instr, psw_val, &id, out);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
produce_set_register(instr, 0, &id, out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
dump_json(filename, out);
|
dump_json(filename, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue