summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-03-30 15:02:01 -0400
committerMatthias Hopf <mhopf@suse.de>2010-04-06 17:47:06 +0200
commitf2a79091cbf3f39e262ea6b22e288806897cf88e (patch)
tree0679e1744053852f57caba5100eeea513af136dc
parentede52b8eed20a8519e08f2413ec64a786a16fb0c (diff)
Handle command table data sections
Signed-off-by: Matthias Hopf <mhopf@suse.de>
-rw-r--r--main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.c b/main.c
index 607ab10..7a1b48f 100644
--- a/main.c
+++ b/main.c
@@ -69,6 +69,7 @@ static int last_reg_index = INDEX_NONE;
static int last_reg_offset = 0;
static int opt_reg_addresses = 0;
+int op_ds (uint8_t *, char *);
int op_0x (uint8_t *, char *);
int op_1x8 (uint8_t *, char *);
int op_1x16 (uint8_t *, char *);
@@ -163,7 +164,7 @@ const optab_t optable[256] = {
{ op_destsrc, "<!doc> SHR", D_PLL, 0, 0 },
{ op_destsrc, "<!doc> SHR", D_MC, 0, 0 },
{ op_0x, "<!doc> DEBUG", D_null, 0, 0 },
- { op_0x, "<!doc> DS", D_null, 0, 0 },
+ { op_ds, "CTB_DS", D_null, 0, 0 },
[0x80] = { op_0x, "<!impl> Extended", D_null, 0, 0 },
[0xff] = { op_0x, "<reserved>", D_null, 0, 0 }
} ;
@@ -305,6 +306,13 @@ int sub_src (uint8_t *d, char *out, int type, int align, int size, int index) {
return r;
}
+int op_ds (uint8_t *d, char *out) {
+ const optab_t *op = &optable[d[0]];
+ uint16_t size = *(uint16_t *) &d[1];
+ out += sprintf (out, "%-5s %d bytes", op->name, size);
+ return size + 3;
+}
+
int op_0x (uint8_t *d, char *out) {
const optab_t *op = &optable[d[0]];
strcpy (out, op->name);