ADC/SBC and other single operand instructions => indirection
Some checks are pending
Build / cmake-builds (push) Waiting to run
Build / makefile (macos-latest, besm6 imlac tt2500 microvax3900 microvax1 rtvax1000 vaxstation3100m76 vaxstation4000m60) (push) Waiting to run
Build / makefile (macos-latest, id16 id32 sds lgp h316 cdc1700 swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 sage pdq3 alpha) (push) Waiting to run
Build / makefile (macos-latest, microvax2 vax730 vax750 vax780 vax8200 vax8600 microvax2000 infoserver100 infoserver150vxt microvax3100 microvax3100e vaxstation3100m30 vaxstation3100m38) (push) Waiting to run
Build / makefile (macos-latest, microvax3100m80 vaxstation4000vlc infoserver1000 nova eclipse hp2100 hp3000 i1401 i1620 s3 altair altairz80 gri i7094) (push) Waiting to run
Build / makefile (macos-latest, pdp1 pdp4 pdp6 pdp7 pdp8 pdp9 pdp10 pdp10-ka pdp10-ki pdp10-kl pdp10-ks pdp11 pdp15 vax) (push) Waiting to run
Build / makefile (macos-latest, scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 sigma uc15 i650 sel32 intel-mds ibm1130) (push) Waiting to run
Build / makefile (ubuntu-latest, besm6 imlac tt2500 microvax3900 microvax1 rtvax1000 vaxstation3100m76 vaxstation4000m60) (push) Waiting to run
Build / makefile (ubuntu-latest, id16 id32 sds lgp h316 cdc1700 swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 sage pdq3 alpha) (push) Waiting to run
Build / makefile (ubuntu-latest, microvax2 vax730 vax750 vax780 vax8200 vax8600 microvax2000 infoserver100 infoserver150vxt microvax3100 microvax3100e vaxstation3100m30 vaxstation3100m38) (push) Waiting to run
Build / makefile (ubuntu-latest, microvax3100m80 vaxstation4000vlc infoserver1000 nova eclipse hp2100 hp3000 i1401 i1620 s3 altair altairz80 gri i7094) (push) Waiting to run
Build / makefile (ubuntu-latest, pdp1 pdp4 pdp6 pdp7 pdp8 pdp9 pdp10 pdp10-ka pdp10-ki pdp10-kl pdp10-ks pdp11 pdp15 vax) (push) Waiting to run
Build / makefile (ubuntu-latest, scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 sigma uc15 i650 sel32 intel-mds ibm1130) (push) Waiting to run
Some checks are pending
Build / cmake-builds (push) Waiting to run
Build / makefile (macos-latest, besm6 imlac tt2500 microvax3900 microvax1 rtvax1000 vaxstation3100m76 vaxstation4000m60) (push) Waiting to run
Build / makefile (macos-latest, id16 id32 sds lgp h316 cdc1700 swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 sage pdq3 alpha) (push) Waiting to run
Build / makefile (macos-latest, microvax2 vax730 vax750 vax780 vax8200 vax8600 microvax2000 infoserver100 infoserver150vxt microvax3100 microvax3100e vaxstation3100m30 vaxstation3100m38) (push) Waiting to run
Build / makefile (macos-latest, microvax3100m80 vaxstation4000vlc infoserver1000 nova eclipse hp2100 hp3000 i1401 i1620 s3 altair altairz80 gri i7094) (push) Waiting to run
Build / makefile (macos-latest, pdp1 pdp4 pdp6 pdp7 pdp8 pdp9 pdp10 pdp10-ka pdp10-ki pdp10-kl pdp10-ks pdp11 pdp15 vax) (push) Waiting to run
Build / makefile (macos-latest, scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 sigma uc15 i650 sel32 intel-mds ibm1130) (push) Waiting to run
Build / makefile (ubuntu-latest, besm6 imlac tt2500 microvax3900 microvax1 rtvax1000 vaxstation3100m76 vaxstation4000m60) (push) Waiting to run
Build / makefile (ubuntu-latest, id16 id32 sds lgp h316 cdc1700 swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 sage pdq3 alpha) (push) Waiting to run
Build / makefile (ubuntu-latest, microvax2 vax730 vax750 vax780 vax8200 vax8600 microvax2000 infoserver100 infoserver150vxt microvax3100 microvax3100e vaxstation3100m30 vaxstation3100m38) (push) Waiting to run
Build / makefile (ubuntu-latest, microvax3100m80 vaxstation4000vlc infoserver1000 nova eclipse hp2100 hp3000 i1401 i1620 s3 altair altairz80 gri i7094) (push) Waiting to run
Build / makefile (ubuntu-latest, pdp1 pdp4 pdp6 pdp7 pdp8 pdp9 pdp10 pdp10-ka pdp10-ki pdp10-kl pdp10-ks pdp11 pdp15 vax) (push) Waiting to run
Build / makefile (ubuntu-latest, scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 sigma uc15 i650 sel32 intel-mds ibm1130) (push) Waiting to run
This commit is contained in:
parent
6cdff6ef6b
commit
9f4f4c0ec0
1 changed files with 46 additions and 48 deletions
54
PDP11/test.c
54
PDP11/test.c
|
@ -343,43 +343,31 @@ void emit_condition_sets()
|
|||
|
||||
void emit_add_sub_c()
|
||||
{
|
||||
printf("ADD/SUB/ADC/SBC instructions\n");
|
||||
const char *const filename = "pdp1170-valtest-ADD_SUB_ADC_SBC.json";
|
||||
printf("ADD/SUB instructions\n");
|
||||
const char *const filename = "pdp1170-valtest-ADD_SUB.json";
|
||||
if (file_exist(filename))
|
||||
return;
|
||||
int id = 0;
|
||||
json_t *out = json_array();
|
||||
for(int group=0; group<4; group++) {
|
||||
for(int group=0; group<2; group++) {
|
||||
for(int word=0; word<2; word++) {
|
||||
uint16_t instr = 0;
|
||||
uint16_t instr = (6 << 12 /* instr */) | (word << 15 /* ADD/SUB */) | (1 << 6 /* src=R1 */);
|
||||
|
||||
if (group == 0 || group == 1)
|
||||
instr = (6 << 12 /* instr */) | (word << 15 /* ADD/SUB */) | (1 << 6 /* src=R1 */);
|
||||
else if (group == 2)
|
||||
instr = (055 << 6 /* instr */) | (word << 15 /* ADCb/ADCw */) | 1 /* src=R1 */;
|
||||
else if (group == 3)
|
||||
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++)
|
||||
produce_set_register(instr, psw_val, &id, out);
|
||||
}
|
||||
else {
|
||||
produce_set_register(instr, 0, &id, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_json(filename, out);
|
||||
}
|
||||
|
||||
void emit_single_operand_instructions()
|
||||
{
|
||||
printf("single operand instructions\n");
|
||||
int groups[] = { 00001, 00003, 00050, 01050, 00051, 01051, 00052, 01052, 00053, 01053, 00054, 01054, 00057, 01057, 00060, 01060, 00061, 01061, 00062, 01062, 00063, 01063, 00067, -1 };
|
||||
int groups[] = { 00001, 00003, 00050, 01050, 00051, 01051, 00052, 01052, 00053, 01053, 00054, 01054, 00055, 01055, 00056, 01056, 00057, 01057, 00060, 01060, 00061, 01061, 00062, 01062, 00063, 01063, 00067, -1 };
|
||||
|
||||
for(int group=0; group<23; group++) {
|
||||
for(int dst=0; dst<2; dst++) {
|
||||
for(int group=0; group<27; group++) {
|
||||
char filename[128] = { 0 };
|
||||
sprintf(filename, "pdp1170-valtest-SINGLE_OPERAND-%o.json", groups[group]);
|
||||
sprintf(filename, "pdp1170-valtest-SINGLE_OPERAND-%o-%d.json", groups[group], dst);
|
||||
if (file_exist(filename))
|
||||
continue;
|
||||
printf("%s \r", filename);
|
||||
|
@ -390,7 +378,7 @@ void emit_single_operand_instructions()
|
|||
|
||||
uint16_t instr = 0;
|
||||
|
||||
if (groups[group] == 00001) // JMP can't jump to a register
|
||||
if (groups[group] == 00001 || dst == 1) // JMP can't jump to a register
|
||||
instr = (groups[group] << 6) | 010; // (R0)
|
||||
else
|
||||
instr = (groups[group] << 6) | 001; // R0
|
||||
|
@ -402,23 +390,33 @@ void emit_single_operand_instructions()
|
|||
saved_PC = 0100;
|
||||
|
||||
randomize_registers_all_values();
|
||||
REGFILE[0][0] = REGFILE[0][1] = test_values[v1];
|
||||
|
||||
init_stack_registers();
|
||||
|
||||
struct mem_t mem[1] = {
|
||||
{ 0100, instr }
|
||||
};
|
||||
|
||||
PSW = psw_val;
|
||||
|
||||
json_t *obj = generate_test(&id, mem, 1, 1);
|
||||
struct mem_t mem[2] = {
|
||||
{ 0100, instr },
|
||||
{ 02000, test_values[v1] }
|
||||
};
|
||||
|
||||
json_t *obj = NULL;
|
||||
|
||||
if (groups[group] == 00001 || dst == 1) {
|
||||
REGFILE[0][0] = REGFILE[0][1] = 02000;
|
||||
obj = generate_test(&id, mem, 2, 1);
|
||||
}
|
||||
else {
|
||||
REGFILE[0][0] = REGFILE[0][1] = test_values[v1];
|
||||
obj = generate_test(&id, mem, 1, 1);
|
||||
}
|
||||
|
||||
if (obj)
|
||||
json_array_append_new(out, obj);
|
||||
}
|
||||
}
|
||||
dump_json(filename, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void emit_cmp()
|
||||
|
|
Loading…
Add table
Reference in a new issue