Rizin
unix-like reverse engineering framework and cli tools
h8300_disas.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2014 Fedor Sakharov <fedor.sakharov@gmail.com>
2
// SPDX-License-Identifier: LGPL-3.0-only
3
4
#ifndef RZ_H8300_DISAS_H
5
#define RZ_H8300_DISAS_H
6
7
#include <
stdint.h
>
8
9
enum
h8300_4bit_opcodes
{
10
H8300_MOV_4BIT_2
= 0x2,
11
H8300_MOV_4BIT_3
= 0x3,
12
H8300_ADD_4BIT
= 0x8,
13
H8300_ADDX_4BIT
= 0x9,
14
H8300_CMP_4BIT
= 0xA,
15
H8300_SUBX_4BIT
= 0xB,
16
H8300_OR_4BIT
= 0xC,
17
H8300_XOR_4BIT
= 0xD,
18
H8300_AND_4BIT
= 0xE,
19
H8300_MOV_4BIT
= 0xF,
20
};
21
22
enum
h8300_opcodes
{
23
H8300_NOP
= 0x00,
24
H8300_SLEEP
= 0x01,
25
H8300_STC
= 0x02,
26
H8300_LDC
= 0x03,
27
H8300_ORC
= 0x04,
28
H8300_XORC
= 0x05,
29
H8300_ANDC
= 0x06,
30
H8300_LDC_2
= 0x07,
31
H8300_ADDB_DIRECT
= 0x08,
32
H8300_ADDW_DIRECT
= 0x09,
33
H8300_INC
= 0x0A,
34
H8300_ADDS
= 0x0B,
35
H8300_MOV_1
= 0x0C,
36
H8300_MOV_2
= 0x0D,
37
H8300_ADDX
= 0x0E,
38
H8300_DAA
= 0x0F,
39
H8300_SHL
= 0x10,
40
H8300_SHR
= 0x11,
41
H8300_ROTL
= 0x12,
42
H8300_ROTR
= 0x13,
43
H8300_OR
= 0x14,
44
H8300_XOR
= 0x15,
45
H8300_AND
= 0x16,
46
H8300_NOT_NEG
= 0x17,
47
H8300_SUB_1
= 0x18,
48
H8300_SUBW
= 0x19,
49
H8300_DEC
= 0x1A,
50
H8300_SUBS
= 0x1B,
51
H8300_CMP_1
= 0x1C,
52
H8300_CMP_2
= 0x1D,
53
H8300_SUBX
= 0x1E,
54
H8300_DAS
= 0x1F,
55
H8300_BRA
= 0x40,
56
H8300_BRN
= 0x41,
57
H8300_BHI
= 0x42,
58
H8300_BLS
= 0x43,
59
H8300_BCC
= 0x44,
60
H8300_BCS
= 0x45,
61
H8300_BNE
= 0x46,
62
H8300_BEQ
= 0x47,
63
H8300_BVC
= 0x48,
64
H8300_BVS
= 0x49,
65
H8300_BPL
= 0x4A,
66
H8300_BMI
= 0x4B,
67
H8300_BGE
= 0x4C,
68
H8300_BLT
= 0x4D,
69
H8300_BGT
= 0x4E,
70
H8300_BLE
= 0x4F,
71
H8300_MULXU
= 0x50,
72
H8300_DIVXU
= 0x51,
73
H8300_RTS
= 0x54,
74
H8300_BSR
= 0x55,
75
H8300_RTE
= 0x56,
76
H8300_JMP_1
= 0x59,
77
H8300_JMP_2
= 0x5A,
78
H8300_JMP_3
= 0x5B,
79
H8300_JSR_1
= 0x5D,
80
H8300_JSR_2
= 0x5E,
81
H8300_JSR_3
= 0x5F,
82
H8300_BSET_1
= 0x60,
83
H8300_BNOT_1
= 0x61,
84
H8300_BCLR_R2R8
= 0x62,
85
H8300_BTST_R2R8
= 0x63,
86
H8300_BST_BIST
= 0x67,
87
H8300_MOV_R82IND16
= 0x68,
88
H8300_MOV_IND162R16
= 0x69,
89
H8300_MOV_R82ABS16
= 0x6a,
90
H8300_MOV_ABS162R16
= 0x6B,
91
H8300_MOV_R82RDEC16
= 0x6C,
92
H8300_MOV_INDINC162R16
= 0x6D,
93
H8300_MOV_R82DISPR16
= 0x6E,
94
H8300_MOV_DISP162R16
= 0x6F,
95
H8300_BSET_2
= 0x70,
96
H8300_BNOT_2
= 0x71,
97
H8300_BCLR_IMM2R8
= 0x72,
98
H8300_BTST
= 0x73,
99
H8300_BOR_BIOR
= 0x74,
100
H8300_BXOR_BIXOR
= 0x75,
101
H8300_BAND_BIAND
= 0x76,
102
H8300_BILD_IMM2R8
= 0x77,
103
H8300_MOV_IMM162R16
= 0x79,
104
H8300_EEPMOV
= 0x7B,
105
H8300_BIAND_IMM2IND16
= 0x7C,
106
H8300_BCLR_R2IND16
= 0x7D,
107
H8300_BIAND_IMM2ABS8
= 0x7E,
108
H8300_BCLR_R2ABS8
= 0x7F,
109
};
110
111
#define H8300_INSTR_MAXLEN 20
112
113
enum
h8300_opcodes_9bit
{
114
H8300_BST
= 0x6700 >> 7,
115
H8300_BIST
= 0x6780 >> 7,
116
H8300_BOR
= 0x7400 >> 7,
117
H8300_BIOR
= 0x7480 >> 7,
118
H8300_BXOR
= 0x7500 >> 7,
119
H8300_BIXOR
= 0x7580 >> 7,
120
H8300_BAND
= 0x7600 >> 7,
121
H8300_BIAND
= 0x7680 >> 7,
122
H8300_BLD
= 0x7700 >> 7,
123
H8300_BILD
= 0x7780 >> 7,
124
};
125
126
struct
h8300_cmd
{
127
char
instr
[
H8300_INSTR_MAXLEN
];
128
char
operands
[
H8300_INSTR_MAXLEN
];
129
};
130
131
int
h8300_decode_command
(
const
ut8
*instr,
struct
h8300_cmd
*
cmd
);
132
133
#endif
/* H8300_DISAS_H */
cmd
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
Definition:
sflib.h:79
H8300_INSTR_MAXLEN
#define H8300_INSTR_MAXLEN
Definition:
h8300_disas.h:111
h8300_decode_command
int h8300_decode_command(const ut8 *instr, struct h8300_cmd *cmd)
Definition:
h8300_disas.c:779
h8300_4bit_opcodes
h8300_4bit_opcodes
Definition:
h8300_disas.h:9
H8300_MOV_4BIT_2
@ H8300_MOV_4BIT_2
Definition:
h8300_disas.h:10
H8300_ADDX_4BIT
@ H8300_ADDX_4BIT
Definition:
h8300_disas.h:13
H8300_ADD_4BIT
@ H8300_ADD_4BIT
Definition:
h8300_disas.h:12
H8300_OR_4BIT
@ H8300_OR_4BIT
Definition:
h8300_disas.h:16
H8300_AND_4BIT
@ H8300_AND_4BIT
Definition:
h8300_disas.h:18
H8300_MOV_4BIT_3
@ H8300_MOV_4BIT_3
Definition:
h8300_disas.h:11
H8300_CMP_4BIT
@ H8300_CMP_4BIT
Definition:
h8300_disas.h:14
H8300_XOR_4BIT
@ H8300_XOR_4BIT
Definition:
h8300_disas.h:17
H8300_SUBX_4BIT
@ H8300_SUBX_4BIT
Definition:
h8300_disas.h:15
H8300_MOV_4BIT
@ H8300_MOV_4BIT
Definition:
h8300_disas.h:19
h8300_opcodes_9bit
h8300_opcodes_9bit
Definition:
h8300_disas.h:113
H8300_BST
@ H8300_BST
Definition:
h8300_disas.h:114
H8300_BIXOR
@ H8300_BIXOR
Definition:
h8300_disas.h:119
H8300_BAND
@ H8300_BAND
Definition:
h8300_disas.h:120
H8300_BIAND
@ H8300_BIAND
Definition:
h8300_disas.h:121
H8300_BILD
@ H8300_BILD
Definition:
h8300_disas.h:123
H8300_BLD
@ H8300_BLD
Definition:
h8300_disas.h:122
H8300_BIST
@ H8300_BIST
Definition:
h8300_disas.h:115
H8300_BOR
@ H8300_BOR
Definition:
h8300_disas.h:116
H8300_BXOR
@ H8300_BXOR
Definition:
h8300_disas.h:118
H8300_BIOR
@ H8300_BIOR
Definition:
h8300_disas.h:117
h8300_opcodes
h8300_opcodes
Definition:
h8300_disas.h:22
H8300_BGE
@ H8300_BGE
Definition:
h8300_disas.h:67
H8300_ORC
@ H8300_ORC
Definition:
h8300_disas.h:27
H8300_SUB_1
@ H8300_SUB_1
Definition:
h8300_disas.h:47
H8300_SLEEP
@ H8300_SLEEP
Definition:
h8300_disas.h:24
H8300_SUBS
@ H8300_SUBS
Definition:
h8300_disas.h:50
H8300_BCC
@ H8300_BCC
Definition:
h8300_disas.h:59
H8300_MOV_IMM162R16
@ H8300_MOV_IMM162R16
Definition:
h8300_disas.h:103
H8300_BOR_BIOR
@ H8300_BOR_BIOR
Definition:
h8300_disas.h:99
H8300_SUBX
@ H8300_SUBX
Definition:
h8300_disas.h:53
H8300_DAS
@ H8300_DAS
Definition:
h8300_disas.h:54
H8300_LDC_2
@ H8300_LDC_2
Definition:
h8300_disas.h:30
H8300_SUBW
@ H8300_SUBW
Definition:
h8300_disas.h:48
H8300_ADDX
@ H8300_ADDX
Definition:
h8300_disas.h:37
H8300_BSET_1
@ H8300_BSET_1
Definition:
h8300_disas.h:82
H8300_SHR
@ H8300_SHR
Definition:
h8300_disas.h:40
H8300_BSR
@ H8300_BSR
Definition:
h8300_disas.h:74
H8300_MOV_R82IND16
@ H8300_MOV_R82IND16
Definition:
h8300_disas.h:87
H8300_BIAND_IMM2IND16
@ H8300_BIAND_IMM2IND16
Definition:
h8300_disas.h:105
H8300_EEPMOV
@ H8300_EEPMOV
Definition:
h8300_disas.h:104
H8300_BNOT_1
@ H8300_BNOT_1
Definition:
h8300_disas.h:83
H8300_BRA
@ H8300_BRA
Definition:
h8300_disas.h:55
H8300_ROTR
@ H8300_ROTR
Definition:
h8300_disas.h:42
H8300_NOT_NEG
@ H8300_NOT_NEG
Definition:
h8300_disas.h:46
H8300_BNE
@ H8300_BNE
Definition:
h8300_disas.h:61
H8300_RTS
@ H8300_RTS
Definition:
h8300_disas.h:73
H8300_CMP_2
@ H8300_CMP_2
Definition:
h8300_disas.h:52
H8300_JMP_2
@ H8300_JMP_2
Definition:
h8300_disas.h:77
H8300_MOV_1
@ H8300_MOV_1
Definition:
h8300_disas.h:35
H8300_BMI
@ H8300_BMI
Definition:
h8300_disas.h:66
H8300_ADDB_DIRECT
@ H8300_ADDB_DIRECT
Definition:
h8300_disas.h:31
H8300_MOV_INDINC162R16
@ H8300_MOV_INDINC162R16
Definition:
h8300_disas.h:92
H8300_BLT
@ H8300_BLT
Definition:
h8300_disas.h:68
H8300_BHI
@ H8300_BHI
Definition:
h8300_disas.h:57
H8300_LDC
@ H8300_LDC
Definition:
h8300_disas.h:26
H8300_BLS
@ H8300_BLS
Definition:
h8300_disas.h:58
H8300_BVC
@ H8300_BVC
Definition:
h8300_disas.h:63
H8300_MOV_R82DISPR16
@ H8300_MOV_R82DISPR16
Definition:
h8300_disas.h:93
H8300_BPL
@ H8300_BPL
Definition:
h8300_disas.h:65
H8300_MOV_ABS162R16
@ H8300_MOV_ABS162R16
Definition:
h8300_disas.h:90
H8300_BCLR_R2IND16
@ H8300_BCLR_R2IND16
Definition:
h8300_disas.h:106
H8300_RTE
@ H8300_RTE
Definition:
h8300_disas.h:75
H8300_DEC
@ H8300_DEC
Definition:
h8300_disas.h:49
H8300_NOP
@ H8300_NOP
Definition:
h8300_disas.h:23
H8300_ROTL
@ H8300_ROTL
Definition:
h8300_disas.h:41
H8300_CMP_1
@ H8300_CMP_1
Definition:
h8300_disas.h:51
H8300_MOV_2
@ H8300_MOV_2
Definition:
h8300_disas.h:36
H8300_MOV_IND162R16
@ H8300_MOV_IND162R16
Definition:
h8300_disas.h:88
H8300_BSET_2
@ H8300_BSET_2
Definition:
h8300_disas.h:95
H8300_BIAND_IMM2ABS8
@ H8300_BIAND_IMM2ABS8
Definition:
h8300_disas.h:107
H8300_INC
@ H8300_INC
Definition:
h8300_disas.h:33
H8300_XOR
@ H8300_XOR
Definition:
h8300_disas.h:44
H8300_MOV_R82ABS16
@ H8300_MOV_R82ABS16
Definition:
h8300_disas.h:89
H8300_XORC
@ H8300_XORC
Definition:
h8300_disas.h:28
H8300_OR
@ H8300_OR
Definition:
h8300_disas.h:43
H8300_DIVXU
@ H8300_DIVXU
Definition:
h8300_disas.h:72
H8300_MOV_R82RDEC16
@ H8300_MOV_R82RDEC16
Definition:
h8300_disas.h:91
H8300_ADDW_DIRECT
@ H8300_ADDW_DIRECT
Definition:
h8300_disas.h:32
H8300_BNOT_2
@ H8300_BNOT_2
Definition:
h8300_disas.h:96
H8300_BCS
@ H8300_BCS
Definition:
h8300_disas.h:60
H8300_BCLR_R2R8
@ H8300_BCLR_R2R8
Definition:
h8300_disas.h:84
H8300_BGT
@ H8300_BGT
Definition:
h8300_disas.h:69
H8300_BAND_BIAND
@ H8300_BAND_BIAND
Definition:
h8300_disas.h:101
H8300_JSR_2
@ H8300_JSR_2
Definition:
h8300_disas.h:80
H8300_BILD_IMM2R8
@ H8300_BILD_IMM2R8
Definition:
h8300_disas.h:102
H8300_JMP_3
@ H8300_JMP_3
Definition:
h8300_disas.h:78
H8300_ANDC
@ H8300_ANDC
Definition:
h8300_disas.h:29
H8300_BST_BIST
@ H8300_BST_BIST
Definition:
h8300_disas.h:86
H8300_ADDS
@ H8300_ADDS
Definition:
h8300_disas.h:34
H8300_JSR_1
@ H8300_JSR_1
Definition:
h8300_disas.h:79
H8300_MULXU
@ H8300_MULXU
Definition:
h8300_disas.h:71
H8300_JMP_1
@ H8300_JMP_1
Definition:
h8300_disas.h:76
H8300_MOV_DISP162R16
@ H8300_MOV_DISP162R16
Definition:
h8300_disas.h:94
H8300_BLE
@ H8300_BLE
Definition:
h8300_disas.h:70
H8300_BVS
@ H8300_BVS
Definition:
h8300_disas.h:64
H8300_SHL
@ H8300_SHL
Definition:
h8300_disas.h:39
H8300_BRN
@ H8300_BRN
Definition:
h8300_disas.h:56
H8300_BTST_R2R8
@ H8300_BTST_R2R8
Definition:
h8300_disas.h:85
H8300_BEQ
@ H8300_BEQ
Definition:
h8300_disas.h:62
H8300_DAA
@ H8300_DAA
Definition:
h8300_disas.h:38
H8300_BXOR_BIXOR
@ H8300_BXOR_BIXOR
Definition:
h8300_disas.h:100
H8300_BTST
@ H8300_BTST
Definition:
h8300_disas.h:98
H8300_BCLR_R2ABS8
@ H8300_BCLR_R2ABS8
Definition:
h8300_disas.h:108
H8300_JSR_3
@ H8300_JSR_3
Definition:
h8300_disas.h:81
H8300_BCLR_IMM2R8
@ H8300_BCLR_IMM2R8
Definition:
h8300_disas.h:97
H8300_AND
@ H8300_AND
Definition:
h8300_disas.h:45
H8300_STC
@ H8300_STC
Definition:
h8300_disas.h:25
ut8
uint8_t ut8
Definition:
lh5801.h:11
stdint.h
h8300_cmd
Definition:
h8300_disas.h:126
h8300_cmd::instr
char instr[H8300_INSTR_MAXLEN]
Definition:
h8300_disas.h:127
operands
Definition:
analysis_or1k.c:9
librz
asm
arch
h8300
h8300_disas.h
Generated by
1.9.1