From bfff919fcc6c2d30139c738459d18a8f68c07246 Mon Sep 17 00:00:00 2001 From: Folkert van Heusden Date: Fri, 4 Apr 2025 23:51:34 +0200 Subject: [PATCH] a single operand instruction has a single operand --- PDP11/test.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/PDP11/test.c b/PDP11/test.c index 366d0ea7..dd15b2a6 100644 --- a/PDP11/test.c +++ b/PDP11/test.c @@ -312,6 +312,55 @@ void emit_add_sub_c() 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 }; + + for(int group=0; group<23; group++) { + char filename[128] = { 0 }; + sprintf(filename, "pdp1170-valtest-SINGLE_OPERAND-%o.json", groups[group]); + if (file_exist(filename)) + continue; + printf("%s \r", filename); + fflush(NULL); + + int id = 0; + json_t *out = json_array(); + + uint16_t instr = 0; + + if (groups[group] == 00001) // JMP can't jump to a register + instr = (groups[group] << 6) | 010; // (R0) + else + instr = (groups[group] << 6) | 001; // R0 + + for(int v1=0; v1