diff options
author | Jeff Law <law@redhat.com> | 1996-11-26 20:40:19 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1996-11-26 20:40:19 +0000 |
commit | b5f831ac51e12e41c27cde38bc07066e62edfd00 (patch) | |
tree | 3bbe8627824f9f8edad5183ee8df537d8885e10d /sim/mn10300/gencode.c | |
parent | 23b01150f50eb4f960fd4ef61e50f88329c985ab (diff) | |
download | gdb-b5f831ac51e12e41c27cde38bc07066e62edfd00.zip gdb-b5f831ac51e12e41c27cde38bc07066e62edfd00.tar.gz gdb-b5f831ac51e12e41c27cde38bc07066e62edfd00.tar.bz2 |
* gencode.c, interp.c: Snapshot current simulator code.
(crude) hashing works, along with dispatch to the OP_* functions.
Diffstat (limited to 'sim/mn10300/gencode.c')
-rw-r--r-- | sim/mn10300/gencode.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/sim/mn10300/gencode.c b/sim/mn10300/gencode.c index d2f5e3b..543bce6 100644 --- a/sim/mn10300/gencode.c +++ b/sim/mn10300/gencode.c @@ -95,8 +95,27 @@ write_opcodes () for (opcode = (struct mn10300_opcode *)mn10300_opcodes; opcode->name; opcode++) { - printf (" { 0x%x,0x%x,OP_%X,", - opcode->opcode, opcode->mask, opcode->opcode); + int size; + + if (opcode->format == FMT_S0) + size = 1; + else if (opcode->format == FMT_S1 + || opcode->format == FMT_D0) + size = 2; + else if (opcode->format == FMT_S2 + || opcode->format == FMT_D1) + size = 3; + else if (opcode->format == FMT_S4) + size = 5; + else if (opcode->format == FMT_D2) + size = 4; + else if (opcode->format == FMT_D4) + size = 6; + else + size = 7; + + printf (" { 0x%x,0x%x,OP_%X,%d,", + opcode->opcode, opcode->mask, opcode->opcode, size); Opcodes[curop++] = opcode->opcode; @@ -139,5 +158,5 @@ write_opcodes () printf ("}},\n"); } - printf ("{ 0,0,NULL,0,{0,0,0,0,0,0}},\n};\n"); + printf ("{ 0,0,NULL,0,0,{0,0,0,0,0,0}},\n};\n"); } |