Rizin
unix-like reverse engineering framework and cli tools
cr16_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_CR16_DISASM_H
5 #define RZ_CR16_DISASM_H
6 
7 #define CR16_INSTR_MAXLEN 24
8 #define STOR_LOAD_MASK 0x181F
9 
43 };
44 
45 struct cr16_cmd {
47  unsigned type;
50 };
51 
52 int cr16_decode_command(const ut8 *instr, struct cr16_cmd *cmd, int len);
53 
55  CR16_ADD = 0x0,
56  CR16_ADDU = 0x1,
57  CR16_BITI = 0x2,
58  CR16_MUL = 0x3,
59  CR16_ASHU = 0x4,
60  CR16_LSH = 0x5,
61  CR16_XOR = 0x6,
62  CR16_CMP = 0x7,
63  CR16_AND = 0x8,
64  CR16_ADDC = 0x9,
65  CR16_BCOND01 = 0xA,
66  CR16_TBIT = 0xB,
67  CR16_MOV = 0xC,
68  CR16_SUB = 0xF,
69  CR16_SUBC = 0xD,
70  CR16_OR = 0xE,
71  CR16_MOVD = 0x19,
72  CR16_MULSB = 0x30,
73  CR16_MULSW = 0x31,
74  CR16_MULUW = 0x3F,
75  CR16_MOVXB = 0x34,
76  CR16_MOVZB = 0x35,
77  CR16_SCOND = 0x37,
78  CR16_TBIT_R_R = 0x3B,
79  CR16_TBIT_I_R = 0x1B,
80  CR16_JUMP = 0x2A,
81  CR16_JAL = 0x3A,
82  CR16_BAL = 0x1A,
83  CR16_LPR = 0x38,
84  CR16_SPR = 0x39,
85  CR16_BCOND_2 = 0x0A,
86  CR16_PUSH = 0xD8,
87  CR16_POP = 0xD9,
88  CR16_POPRET_1 = 0xDA,
89  CR16_POPRET_2 = 0xDB,
90  CR16_LOADM = 0xFC,
91  CR16_STORM = 0xFD,
92 };
93 
95  CR16_RETX = 0x79FE,
96  CR16_DI = 0x7DDE,
97  CR16_EI = 0x7DFE,
98  CR16_NOP = 0x0200,
99  CR16_WAIT = 0x7FFE,
100  CR16_EWAIT = 0x7FD6,
101 };
102 
104  CR16_I_R = 0x0,
105  CR16_R_R = 0x1,
106 };
107 
108 enum cr16_regs {
109  CR16_R0 = 0,
126 };
127 
129  CR16_PSR = 0x1,
131  CR16_ISP = 0xB,
132 };
133 
149 };
150 
151 #endif /* CR16_DISASM_H */
size_t len
Definition: 6502dis.c:15
cr16_cmd_forms
Definition: cr16_disas.h:103
@ CR16_R_R
Definition: cr16_disas.h:105
@ CR16_I_R
Definition: cr16_disas.h:104
cr16_opcodes
Definition: cr16_disas.h:54
@ CR16_CMP
Definition: cr16_disas.h:62
@ CR16_ASHU
Definition: cr16_disas.h:59
@ CR16_SUB
Definition: cr16_disas.h:68
@ CR16_JUMP
Definition: cr16_disas.h:80
@ CR16_MULUW
Definition: cr16_disas.h:74
@ CR16_BCOND01
Definition: cr16_disas.h:65
@ CR16_MOVD
Definition: cr16_disas.h:71
@ CR16_PUSH
Definition: cr16_disas.h:86
@ CR16_BCOND_2
Definition: cr16_disas.h:85
@ CR16_SUBC
Definition: cr16_disas.h:69
@ CR16_LSH
Definition: cr16_disas.h:60
@ CR16_XOR
Definition: cr16_disas.h:61
@ CR16_LOADM
Definition: cr16_disas.h:90
@ CR16_SCOND
Definition: cr16_disas.h:77
@ CR16_OR
Definition: cr16_disas.h:70
@ CR16_MOV
Definition: cr16_disas.h:67
@ CR16_BAL
Definition: cr16_disas.h:82
@ CR16_AND
Definition: cr16_disas.h:63
@ CR16_BITI
Definition: cr16_disas.h:57
@ CR16_ADDU
Definition: cr16_disas.h:56
@ CR16_ADD
Definition: cr16_disas.h:55
@ CR16_MOVXB
Definition: cr16_disas.h:75
@ CR16_POPRET_2
Definition: cr16_disas.h:89
@ CR16_TBIT_R_R
Definition: cr16_disas.h:78
@ CR16_MOVZB
Definition: cr16_disas.h:76
@ CR16_POP
Definition: cr16_disas.h:87
@ CR16_MUL
Definition: cr16_disas.h:58
@ CR16_SPR
Definition: cr16_disas.h:84
@ CR16_TBIT_I_R
Definition: cr16_disas.h:79
@ CR16_LPR
Definition: cr16_disas.h:83
@ CR16_ADDC
Definition: cr16_disas.h:64
@ CR16_MULSB
Definition: cr16_disas.h:72
@ CR16_STORM
Definition: cr16_disas.h:91
@ CR16_MULSW
Definition: cr16_disas.h:73
@ CR16_POPRET_1
Definition: cr16_disas.h:88
@ CR16_TBIT
Definition: cr16_disas.h:66
@ CR16_JAL
Definition: cr16_disas.h:81
cr16_regs
Definition: cr16_disas.h:108
@ CR16_RA
Definition: cr16_disas.h:123
@ CR16_LAST
Definition: cr16_disas.h:125
@ CR16_R4
Definition: cr16_disas.h:113
@ CR16_R0
Definition: cr16_disas.h:109
@ CR16_R1
Definition: cr16_disas.h:110
@ CR16_R8
Definition: cr16_disas.h:117
@ CR16_R12
Definition: cr16_disas.h:121
@ CR16_R2
Definition: cr16_disas.h:111
@ CR16_R7
Definition: cr16_disas.h:116
@ CR16_R6
Definition: cr16_disas.h:115
@ CR16_R9
Definition: cr16_disas.h:118
@ CR16_R5
Definition: cr16_disas.h:114
@ CR16_SP
Definition: cr16_disas.h:124
@ CR16_R10
Definition: cr16_disas.h:119
@ CR16_R11
Definition: cr16_disas.h:120
@ CR16_R13
Definition: cr16_disas.h:122
@ CR16_R3
Definition: cr16_disas.h:112
cr16_dedic_regs
Definition: cr16_disas.h:128
@ CR16_ISP
Definition: cr16_disas.h:131
@ CR16_INTBASE
Definition: cr16_disas.h:130
@ CR16_PSR
Definition: cr16_disas.h:129
cr16_opcodes_long
Definition: cr16_disas.h:94
@ CR16_WAIT
Definition: cr16_disas.h:99
@ CR16_EWAIT
Definition: cr16_disas.h:100
@ CR16_DI
Definition: cr16_disas.h:96
@ CR16_NOP
Definition: cr16_disas.h:98
@ CR16_EI
Definition: cr16_disas.h:97
@ CR16_RETX
Definition: cr16_disas.h:95
cr16_conds
Definition: cr16_disas.h:134
@ CR16_COND_EQ
Definition: cr16_disas.h:135
@ CR16_COND_HI
Definition: cr16_disas.h:139
@ CR16_COND_CC
Definition: cr16_disas.h:138
@ CR16_COND_LE
Definition: cr16_disas.h:142
@ CR16_COND_GT
Definition: cr16_disas.h:141
@ CR16_COND_LT
Definition: cr16_disas.h:147
@ CR16_COND_GE
Definition: cr16_disas.h:148
@ CR16_COND_HS
Definition: cr16_disas.h:146
@ CR16_COND_FC
Definition: cr16_disas.h:144
@ CR16_COND_FS
Definition: cr16_disas.h:143
@ CR16_COND_LO
Definition: cr16_disas.h:145
@ CR16_COND_LS
Definition: cr16_disas.h:140
@ CR16_COND_CS
Definition: cr16_disas.h:137
@ CR16_COND_NE
Definition: cr16_disas.h:136
#define CR16_INSTR_MAXLEN
Definition: cr16_disas.h:7
cr16_cmd_types
Definition: cr16_disas.h:10
@ CR16_TYPE_EI
Definition: cr16_disas.h:39
@ CR16_TYPE_DI
Definition: cr16_disas.h:38
@ CR16_TYPE_JAL
Definition: cr16_disas.h:30
@ CR16_TYPE_BE
Definition: cr16_disas.h:16
@ CR16_TYPE_EXCP
Definition: cr16_disas.h:28
@ CR16_TYPE_BNE
Definition: cr16_disas.h:17
@ CR16_TYPE_JUMP
Definition: cr16_disas.h:31
@ CR16_TYPE_STOR
Definition: cr16_disas.h:37
@ CR16_TYPE_BIT
Definition: cr16_disas.h:23
@ CR16_TYPE_RETX
Definition: cr16_disas.h:33
@ CR16_TYPE_BR
Definition: cr16_disas.h:27
@ CR16_TYPE_MOV
Definition: cr16_disas.h:11
@ CR16_TYPE_SLPR
Definition: cr16_disas.h:24
@ CR16_TYPE_MUL
Definition: cr16_disas.h:13
@ CR16_TYPE_SUB
Definition: cr16_disas.h:14
@ CR16_TYPE_PUSH
Definition: cr16_disas.h:34
@ CR16_TYPE_WAIT
Definition: cr16_disas.h:41
@ CR16_TYPE_POP
Definition: cr16_disas.h:35
@ CR16_TYPE_BAL
Definition: cr16_disas.h:26
@ CR16_TYPE_JUMP_UNK
Definition: cr16_disas.h:32
@ CR16_TYPE_SCOND
Definition: cr16_disas.h:20
@ CR16_TYPE_LOAD
Definition: cr16_disas.h:36
@ CR16_TYPE_OR
Definition: cr16_disas.h:19
@ CR16_TYPE_XOR
Definition: cr16_disas.h:21
@ CR16_TYPE_SHIFT
Definition: cr16_disas.h:22
@ CR16_TYPE_ADD
Definition: cr16_disas.h:12
@ CR16_TYPE_CMP
Definition: cr16_disas.h:15
@ CR16_TYPE_NOP
Definition: cr16_disas.h:40
@ CR16_TYPE_EWAIT
Definition: cr16_disas.h:42
@ CR16_TYPE_BCOND
Definition: cr16_disas.h:25
@ CR16_TYPE_AND
Definition: cr16_disas.h:18
@ CR16_TYPE_JCOND
Definition: cr16_disas.h:29
int cr16_decode_command(const ut8 *instr, struct cr16_cmd *cmd, int len)
Definition: cr16_disas.c:1184
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
uint8_t ut8
Definition: lh5801.h:11
#define st32
Definition: rz_types_base.h:12
unsigned type
Definition: cr16_disas.h:47
char instr[CR16_INSTR_MAXLEN]
Definition: cr16_disas.h:48
st32 reladdr
Definition: cr16_disas.h:46