1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include "mnemonics.h"
const struct mnemonic mnemonics[] = {
{ "add", 0x0000, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* add */
{ "sub", 0x0001, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* subtract */
{ "mul", 0x0002, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* multiply */
{ "div", 0x0003, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* divide */
{ "and", 0x0100, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* bitwise and */
{ "or", 0x0101, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* bitwise or */
{ "xor", 0x0102, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* bitwise exclusive or */
{ "lsl", 0x1000, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* logical shift left */
{ "lsr", 0x1100, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* logical shift right */
{ "asl", 0x1002, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* arithmetic shift left (fills with lsb) */
{ "asr", 0x1102, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* arithmetic shift right (fills with msb) */
{ "rol", 0x1003, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* rotate left */
{ "ror", 0x1103, 0xf103, { {REG, 9}, {REG, 5}, {REG, 2} } }, /* rotate right */
{ "not", 0x2000, 0xf1e3, { {REG, 9}, {REG, 2} } }, /* bitwise inverse */
{ "neg", 0x2100, 0xf1e3, { {REG, 9}, {REG, 2} } }, /* negate */
{ "btc", 0x3000, 0xf11f, { {REG, 9}, {REG, 2} } }, /* bit clear */
{ "bts", 0x3100, 0xf11f, { {REG, 9}, {REG, 2} } }, /* bit set */
{ "mov", 0x4004, 0xf11f, { {REG, 9}, {REG, 5} } }, /* register move */
{ "st.b", 0x4100, 0xf11f, { {REGPTR, 9}, {REG, 5} } }, /* store byte */
{ "st.w", 0x4104, 0xf11f, { {REGPTR, 9}, {REG, 5} } }, /* store word */
{ "ld.bl", 0x4101, 0xf11f, { {REG, 9}, {REGPTR, 5} } }, /* load byte into low byte of register */
{ "ld.bh", 0x4111, 0xf11f, { {REG, 9}, {REGPTR, 5} } }, /* load byte into high byte of register */
{ "ld.w", 0x4105, 0xf11f, { {REG, 9}, {REGPTR, 5} } }, /* load word */
{ "ldi.bl", 0x5000, 0xf100, { {REG, 9}, {IMM, 0} } }, /* load immediate into low byte of register */
{ "ldi.bh", 0x5100, 0xf100, { {REG, 9}, {IMM, 0} } }, /* load immediate into high byte of register */
{ "beq", 0x6000, 0xff00, { {PCOFF, 0}, } }, /* branch if equal */
{ "bne", 0x6200, 0xff00, { {PCOFF, 0}, } }, /* branch if not equal */
{ "bgt", 0x6400, 0xff00, { {PCOFF, 0}, } }, /* branch if greater than */
{ "bge", 0x6600, 0xff00, { {PCOFF, 0}, } }, /* branch if greater than or equal */
{ "blt", 0x6800, 0xff00, { {PCOFF, 0}, } }, /* branch if less than */
{ "ble", 0x6a00, 0xff00, { {PCOFF, 0}, } }, /* branch if less than or equal */
{ "bra", 0x6e00, 0xff00, { {PCOFF, 0}, } }, /* branch always */
{ "jmp", 0x7000, 0xff1f, { {REGPTR, 5}, } }, /* branch always */
{ "addpc", 0x8000, 0xf100, { {REG, 9}, {IMM, 0} } }, /* add program counter and immediate */
{ "nop", 0xf000, 0xf000, { } }, /* no operation */
};
|