39 0, 1, 2, 2, 2, 3, 3, 2, 2, 1, 1, 1, 2, 2, 2, 2
45 "add",
"sub",
"mul",
"div",
"mod",
46 "shl",
"shr",
"and",
"bor",
"xor",
47 "ife",
"ifn",
"ifg",
"ifb"
50 static const char *
opNameB[] = {
"reserved",
"jsr" };
52 static const char *
regs[] = {
53 "a",
"b",
"c",
"x",
"y",
"z",
"i",
"j",
54 "pop",
"peek",
"push",
"sp",
"pc",
"o"
58 return ((
type <= 0x17) && (
type > 0x0f)) || (
type == 0x1e) || (
type == 0x1f);
78 char arg[32], arg2[32];
82 strncpy(
out,
"invalid", size_out);
83 out[size_out - 1] = 0;
const lzma_allocator const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
static int valPrint(char *out, size_t size_out, ut8 type, ut16 value)
static int needWord(ut8 type)
static const char * regs[]
static int instrPrint(char *out, size_t size_out, const op *o)
static const char * opNameB[]
static int instrGetCycles(const op *o)
static const char * opName[]
static const int opCycle[]
int dcpu16_disasm(char *out, size_t size_out, const ut16 *inp, int len, int *cost)
static const int opCycleB[]
static int instrGet(ut16 in, op *o, ut16 a, ut16 b)