#include <rz_asm.h>
#include <rz_types.h>
#include <string.h>
#include <stdio.h>
Go to the source code of this file.
◆ i4004_get_ins_len()
static int i4004_get_ins_len |
( |
ut8 |
hex | ) |
|
|
static |
◆ i4004dis()
Definition at line 61 of file i4004dis.c.
63 ut8 high = (*
buf & 0xf0) >> 4;
65 const char *buf_asm =
"invalid";
70 case 0: buf_asm = low ?
"invalid" :
"nop";
break;
71 case 1: buf_asm =
sdb_fmt(
"jcn %d 0x%02x", low,
buf[1]);
break;
74 buf_asm =
sdb_fmt(
"src r%d", (low & 0xe));
76 buf_asm =
sdb_fmt(
"fim r%d, 0x%02x", (low & 0xe),
buf[1]);
81 buf_asm =
sdb_fmt(
"jin r%d", (low & 0xe));
83 buf_asm =
sdb_fmt(
"fin r%d", (low & 0xe));
86 case 4: buf_asm =
sdb_fmt(
"jun 0x%03x", ((
ut16)(low << 8) |
buf[1]));
break;
87 case 5: buf_asm =
sdb_fmt(
"jms 0x%03x", ((
ut16)(low << 8) |
buf[1]));
break;
88 case 6: buf_asm =
sdb_fmt(
"inc r%d", low);
break;
89 case 7: buf_asm =
sdb_fmt(
"isz r%d, 0x%02x", low,
buf[1]);
break;
90 case 8: buf_asm =
sdb_fmt(
"add r%d", low);
break;
91 case 9: buf_asm =
sdb_fmt(
"sub r%d", low);
break;
92 case 10: buf_asm =
sdb_fmt(
"ld r%d", low);
break;
93 case 11: buf_asm =
sdb_fmt(
"xch r%d", low);
break;
94 case 12: buf_asm =
sdb_fmt(
"bbl %d", low);
break;
95 case 13: buf_asm =
sdb_fmt(
"ldm %d", low);
break;
96 case 14: buf_asm =
i4004_e[low];
break;
97 case 15: buf_asm =
i4004_f[low];
break;
100 return op->size = rlen;
RZ_API char * sdb_fmt(const char *fmt,...)
static const char * i4004_f[16]
static int i4004_get_ins_len(ut8 hex)
static const char * i4004_e[16]
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
References i4004_e, i4004_f, i4004_get_ins_len(), len, rz_strbuf_set(), and sdb_fmt().
Referenced by disassemble().
◆ i4004_e
Initial value:= {
"wrm",
"wmp",
"wrr",
"wpm",
"wr0",
"wr1",
"wr2",
"wr3",
"sbm",
"rdm",
"rdr",
"adm",
"rd0",
"rd1",
"rd2",
"rd3"
}
Definition at line 15 of file i4004dis.c.
Referenced by i4004dis().
◆ i4004_f
Initial value:= {
"clb",
"clc",
"iac",
"cmc",
"cma",
"ral",
"rar",
"tcc",
"dac",
"tcs",
"stc",
"daa",
"kbp",
"dcl",
"invalid",
"invalid"
}
Definition at line 34 of file i4004dis.c.
Referenced by i4004dis().
◆ i4004_ins_len
Initial value:= {
1, 2, 3, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1
}
Definition at line 11 of file i4004dis.c.
Referenced by i4004_get_ins_len().