BIC/BIS: also (R1) target
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:
Folkert van Heusden 2025-04-06 17:53:24 +02:00
parent dd67a2a276
commit 4b60b47a60
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -195,6 +195,39 @@ void produce_set_register(const uint16_t instr, const uint16_t psw, int *const i
} }
} }
void produce_set_register_indirect(const uint16_t instr, const uint16_t psw, int *const id, json_t *const out)
{
if (((instr >> 3) & 7) != 1 || (instr & 7) != 1) {
printf("Not an R1 target!");
return;
}
for(int v1=0; v1<n_test_values; v1++) {
for(int v2=0; v2<n_test_values; v2++) {
init_simh();
saved_PC = 0100;
randomize_registers_all_values();
REGFILE[0][0] = REGFILE[0][1] = test_values[v1];
REGFILE[1][0] = REGFILE[1][1] = 01002;
init_stack_registers();
struct mem_t mem[2] = {
{ 0100, instr },
{ 01002, test_values[v2] }
};
PSW = psw;
json_t *obj = generate_test(instr, id, mem, 2);
if (obj)
json_array_append_new(out, obj);
}
}
}
void dump_json(const char *const filename, json_t *const j) void dump_json(const char *const filename, json_t *const j)
{ {
FILE *fh = fopen(filename, "w"); FILE *fh = fopen(filename, "w");
@ -400,20 +433,25 @@ void emit_add_double_oper_instr()
void emit_bit_instructions() void emit_bit_instructions()
{ {
printf("bit instructions\n"); printf("bit instructions\n");
const char *const filename = "pdp1170-valtest-BIT-INSTRUCTIONS.json"; for(int group=3; group<6; group++) {
if (file_exist(filename)) char filename[64];
return; sprintf(filename, "pdp1170-valtest-BIT-INSTRUCTIONS-%d.json", group);
int id = 0; if (file_exist(filename))
json_t *out = json_array(); return;
for(int word=0; word<2; word++) { int id = 0;
for(int group=3; group<6; group++) { json_t *out = json_array();
uint16_t instr = (word << 15) | (group << 12) | (1 << 6 /* src=R1 */); for(int word=0; word<2; word++) {
uint16_t instr = (word << 15) | (group << 12) | 011 /* target is '(R1)' */;
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);
if (group == 4 || group == 5)
produce_set_register_indirect(instr, psw_val, &id, out);
}
} }
dump_json(filename, out);
} }
dump_json(filename, out);
} }
void emit_misc_operations() void emit_misc_operations()