Rizin
unix-like reverse engineering framework and cli tools
disassembler.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
2
// SPDX-License-Identifier: LGPL-3.0-only
3
4
#ifndef RZ_ASM_AVR_DISASSEMBLER_H
5
#define RZ_ASM_AVR_DISASSEMBLER_H
6
#include <
rz_types.h
>
7
#include <
rz_util.h
>
8
9
typedef
enum
{
10
AVR_OP_INVALID
= 0,
11
AVR_OP_ADC
,
12
AVR_OP_ADD
,
13
AVR_OP_ADIW
,
14
AVR_OP_AND
,
15
AVR_OP_ANDI
,
16
AVR_OP_ASR
,
17
AVR_OP_BLD
,
18
AVR_OP_BRCC
,
19
AVR_OP_BRCS
,
20
AVR_OP_BREAK
,
21
AVR_OP_BREQ
,
22
AVR_OP_BRGE
,
23
AVR_OP_BRHC
,
24
AVR_OP_BRHS
,
25
AVR_OP_BRID
,
26
AVR_OP_BRIE
,
27
AVR_OP_BRLO
,
28
AVR_OP_BRLT
,
29
AVR_OP_BRMI
,
30
AVR_OP_BRNE
,
31
AVR_OP_BRPL
,
32
AVR_OP_BRSH
,
33
AVR_OP_BRTC
,
34
AVR_OP_BRTS
,
35
AVR_OP_BRVC
,
36
AVR_OP_BRVS
,
37
AVR_OP_BST
,
38
AVR_OP_CALL
,
39
AVR_OP_CBI
,
40
AVR_OP_CLC
,
41
AVR_OP_CLH
,
42
AVR_OP_CLI
,
43
AVR_OP_CLN
,
44
AVR_OP_CLR
,
45
AVR_OP_CLS
,
46
AVR_OP_CLT
,
47
AVR_OP_CLV
,
48
AVR_OP_CLZ
,
49
AVR_OP_COM
,
50
AVR_OP_CP
,
51
AVR_OP_CPC
,
52
AVR_OP_CPI
,
53
AVR_OP_CPSE
,
54
AVR_OP_DEC
,
55
AVR_OP_DES
,
56
AVR_OP_EICALL
,
57
AVR_OP_EIJMP
,
58
AVR_OP_ELPM
,
59
AVR_OP_EOR
,
60
AVR_OP_FMUL
,
61
AVR_OP_FMULS
,
62
AVR_OP_FMULSU
,
63
AVR_OP_ICALL
,
64
AVR_OP_IJMP
,
65
AVR_OP_IN
,
66
AVR_OP_INC
,
67
AVR_OP_JMP
,
68
AVR_OP_LAC
,
69
AVR_OP_LAS
,
70
AVR_OP_LAT
,
71
AVR_OP_LD
,
72
AVR_OP_LDD
,
73
AVR_OP_LDI
,
74
AVR_OP_LDS
,
75
AVR_OP_LPM
,
76
AVR_OP_LSL
,
77
AVR_OP_LSR
,
78
AVR_OP_MOV
,
79
AVR_OP_MOVW
,
80
AVR_OP_MUL
,
81
AVR_OP_MULS
,
82
AVR_OP_MULSU
,
83
AVR_OP_NEG
,
84
AVR_OP_NOP
,
85
AVR_OP_OR
,
86
AVR_OP_ORI
,
87
AVR_OP_OUT
,
88
AVR_OP_POP
,
89
AVR_OP_PUSH
,
90
AVR_OP_RCALL
,
91
AVR_OP_RET
,
92
AVR_OP_RETI
,
93
AVR_OP_RJMP
,
94
AVR_OP_ROL
,
95
AVR_OP_ROR
,
96
AVR_OP_SBC
,
97
AVR_OP_SBCI
,
98
AVR_OP_SBI
,
99
AVR_OP_SBIC
,
100
AVR_OP_SBIS
,
101
AVR_OP_SBIW
,
102
AVR_OP_SBRC
,
103
AVR_OP_SBRS
,
104
AVR_OP_SEC
,
105
AVR_OP_SEH
,
106
AVR_OP_SEI
,
107
AVR_OP_SEN
,
108
AVR_OP_SER
,
109
AVR_OP_SES
,
110
AVR_OP_SET
,
111
AVR_OP_SEV
,
112
AVR_OP_SEZ
,
113
AVR_OP_SLEEP
,
114
AVR_OP_SPM
,
115
AVR_OP_ST
,
116
AVR_OP_STD
,
117
AVR_OP_STS
,
118
AVR_OP_SUB
,
119
AVR_OP_SUBI
,
120
AVR_OP_SWAP
,
121
AVR_OP_TST
,
122
AVR_OP_WDR
,
123
AVR_OP_XCH
,
124
/* end */
125
AVR_OP_SIZE
126
}
AVROpMnem
;
127
128
typedef
struct
avr_opcode_t
{
129
AVROpMnem
mnemonic
;
130
ut16
mask
;
131
ut16
param
[4];
132
ut16
cycles
;
133
ut16
size
;
134
}
AVROp
;
135
136
ut32
avr_disassembler
(
const
ut8
*
buffer
,
const
ut32
size
,
ut64
pc
,
bool
be,
AVROp
* aop,
RzStrBuf
*
sb
);
137
138
#endif
/* RZ_ASM_AVR_DISASSEMBLER_H */
pc
pc
Definition:
arm-arithmetic-aliases.s.cs:50
avr_disassembler
ut32 avr_disassembler(const ut8 *buffer, const ut32 size, ut64 pc, bool be, AVROp *aop, RzStrBuf *sb)
Definition:
disassembler.c:773
AVROpMnem
AVROpMnem
Definition:
disassembler.h:9
AVR_OP_AND
@ AVR_OP_AND
Definition:
disassembler.h:14
AVR_OP_INC
@ AVR_OP_INC
Definition:
disassembler.h:66
AVR_OP_BREAK
@ AVR_OP_BREAK
Definition:
disassembler.h:20
AVR_OP_DEC
@ AVR_OP_DEC
Definition:
disassembler.h:54
AVR_OP_BRNE
@ AVR_OP_BRNE
Definition:
disassembler.h:30
AVR_OP_MUL
@ AVR_OP_MUL
Definition:
disassembler.h:80
AVR_OP_CP
@ AVR_OP_CP
Definition:
disassembler.h:50
AVR_OP_CPC
@ AVR_OP_CPC
Definition:
disassembler.h:51
AVR_OP_SPM
@ AVR_OP_SPM
Definition:
disassembler.h:114
AVR_OP_INVALID
@ AVR_OP_INVALID
Definition:
disassembler.h:10
AVR_OP_IJMP
@ AVR_OP_IJMP
Definition:
disassembler.h:64
AVR_OP_LDD
@ AVR_OP_LDD
Definition:
disassembler.h:72
AVR_OP_FMULSU
@ AVR_OP_FMULSU
Definition:
disassembler.h:62
AVR_OP_LAT
@ AVR_OP_LAT
Definition:
disassembler.h:70
AVR_OP_BRSH
@ AVR_OP_BRSH
Definition:
disassembler.h:32
AVR_OP_SWAP
@ AVR_OP_SWAP
Definition:
disassembler.h:120
AVR_OP_CBI
@ AVR_OP_CBI
Definition:
disassembler.h:39
AVR_OP_LSR
@ AVR_OP_LSR
Definition:
disassembler.h:77
AVR_OP_SBCI
@ AVR_OP_SBCI
Definition:
disassembler.h:97
AVR_OP_BRGE
@ AVR_OP_BRGE
Definition:
disassembler.h:22
AVR_OP_ADIW
@ AVR_OP_ADIW
Definition:
disassembler.h:13
AVR_OP_CPSE
@ AVR_OP_CPSE
Definition:
disassembler.h:53
AVR_OP_SBRC
@ AVR_OP_SBRC
Definition:
disassembler.h:102
AVR_OP_ASR
@ AVR_OP_ASR
Definition:
disassembler.h:16
AVR_OP_CLH
@ AVR_OP_CLH
Definition:
disassembler.h:41
AVR_OP_CLZ
@ AVR_OP_CLZ
Definition:
disassembler.h:48
AVR_OP_SEN
@ AVR_OP_SEN
Definition:
disassembler.h:107
AVR_OP_ADC
@ AVR_OP_ADC
Definition:
disassembler.h:11
AVR_OP_BRPL
@ AVR_OP_BRPL
Definition:
disassembler.h:31
AVR_OP_BRLT
@ AVR_OP_BRLT
Definition:
disassembler.h:28
AVR_OP_MOVW
@ AVR_OP_MOVW
Definition:
disassembler.h:79
AVR_OP_CLT
@ AVR_OP_CLT
Definition:
disassembler.h:46
AVR_OP_NOP
@ AVR_OP_NOP
Definition:
disassembler.h:84
AVR_OP_BRCS
@ AVR_OP_BRCS
Definition:
disassembler.h:19
AVR_OP_MOV
@ AVR_OP_MOV
Definition:
disassembler.h:78
AVR_OP_EOR
@ AVR_OP_EOR
Definition:
disassembler.h:59
AVR_OP_SEI
@ AVR_OP_SEI
Definition:
disassembler.h:106
AVR_OP_SES
@ AVR_OP_SES
Definition:
disassembler.h:109
AVR_OP_BRTS
@ AVR_OP_BRTS
Definition:
disassembler.h:34
AVR_OP_LSL
@ AVR_OP_LSL
Definition:
disassembler.h:76
AVR_OP_SEV
@ AVR_OP_SEV
Definition:
disassembler.h:111
AVR_OP_LDI
@ AVR_OP_LDI
Definition:
disassembler.h:73
AVR_OP_SUB
@ AVR_OP_SUB
Definition:
disassembler.h:118
AVR_OP_ROL
@ AVR_OP_ROL
Definition:
disassembler.h:94
AVR_OP_SER
@ AVR_OP_SER
Definition:
disassembler.h:108
AVR_OP_COM
@ AVR_OP_COM
Definition:
disassembler.h:49
AVR_OP_ORI
@ AVR_OP_ORI
Definition:
disassembler.h:86
AVR_OP_BRCC
@ AVR_OP_BRCC
Definition:
disassembler.h:18
AVR_OP_LDS
@ AVR_OP_LDS
Definition:
disassembler.h:74
AVR_OP_LPM
@ AVR_OP_LPM
Definition:
disassembler.h:75
AVR_OP_RJMP
@ AVR_OP_RJMP
Definition:
disassembler.h:93
AVR_OP_STS
@ AVR_OP_STS
Definition:
disassembler.h:117
AVR_OP_LAS
@ AVR_OP_LAS
Definition:
disassembler.h:69
AVR_OP_SEH
@ AVR_OP_SEH
Definition:
disassembler.h:105
AVR_OP_XCH
@ AVR_OP_XCH
Definition:
disassembler.h:123
AVR_OP_LAC
@ AVR_OP_LAC
Definition:
disassembler.h:68
AVR_OP_ADD
@ AVR_OP_ADD
Definition:
disassembler.h:12
AVR_OP_BRLO
@ AVR_OP_BRLO
Definition:
disassembler.h:27
AVR_OP_SBIC
@ AVR_OP_SBIC
Definition:
disassembler.h:99
AVR_OP_BRIE
@ AVR_OP_BRIE
Definition:
disassembler.h:26
AVR_OP_ST
@ AVR_OP_ST
Definition:
disassembler.h:115
AVR_OP_BRTC
@ AVR_OP_BRTC
Definition:
disassembler.h:33
AVR_OP_ICALL
@ AVR_OP_ICALL
Definition:
disassembler.h:63
AVR_OP_SBIW
@ AVR_OP_SBIW
Definition:
disassembler.h:101
AVR_OP_FMUL
@ AVR_OP_FMUL
Definition:
disassembler.h:60
AVR_OP_CLV
@ AVR_OP_CLV
Definition:
disassembler.h:47
AVR_OP_OUT
@ AVR_OP_OUT
Definition:
disassembler.h:87
AVR_OP_CLN
@ AVR_OP_CLN
Definition:
disassembler.h:43
AVR_OP_CLI
@ AVR_OP_CLI
Definition:
disassembler.h:42
AVR_OP_RETI
@ AVR_OP_RETI
Definition:
disassembler.h:92
AVR_OP_CLS
@ AVR_OP_CLS
Definition:
disassembler.h:45
AVR_OP_SET
@ AVR_OP_SET
Definition:
disassembler.h:110
AVR_OP_SIZE
@ AVR_OP_SIZE
Definition:
disassembler.h:125
AVR_OP_BREQ
@ AVR_OP_BREQ
Definition:
disassembler.h:21
AVR_OP_MULS
@ AVR_OP_MULS
Definition:
disassembler.h:81
AVR_OP_ANDI
@ AVR_OP_ANDI
Definition:
disassembler.h:15
AVR_OP_BRMI
@ AVR_OP_BRMI
Definition:
disassembler.h:29
AVR_OP_SEZ
@ AVR_OP_SEZ
Definition:
disassembler.h:112
AVR_OP_ROR
@ AVR_OP_ROR
Definition:
disassembler.h:95
AVR_OP_POP
@ AVR_OP_POP
Definition:
disassembler.h:88
AVR_OP_BRHS
@ AVR_OP_BRHS
Definition:
disassembler.h:24
AVR_OP_SEC
@ AVR_OP_SEC
Definition:
disassembler.h:104
AVR_OP_EIJMP
@ AVR_OP_EIJMP
Definition:
disassembler.h:57
AVR_OP_OR
@ AVR_OP_OR
Definition:
disassembler.h:85
AVR_OP_FMULS
@ AVR_OP_FMULS
Definition:
disassembler.h:61
AVR_OP_BRHC
@ AVR_OP_BRHC
Definition:
disassembler.h:23
AVR_OP_SBIS
@ AVR_OP_SBIS
Definition:
disassembler.h:100
AVR_OP_CPI
@ AVR_OP_CPI
Definition:
disassembler.h:52
AVR_OP_TST
@ AVR_OP_TST
Definition:
disassembler.h:121
AVR_OP_SBI
@ AVR_OP_SBI
Definition:
disassembler.h:98
AVR_OP_RET
@ AVR_OP_RET
Definition:
disassembler.h:91
AVR_OP_BRVS
@ AVR_OP_BRVS
Definition:
disassembler.h:36
AVR_OP_PUSH
@ AVR_OP_PUSH
Definition:
disassembler.h:89
AVR_OP_BRID
@ AVR_OP_BRID
Definition:
disassembler.h:25
AVR_OP_SBC
@ AVR_OP_SBC
Definition:
disassembler.h:96
AVR_OP_LD
@ AVR_OP_LD
Definition:
disassembler.h:71
AVR_OP_CLR
@ AVR_OP_CLR
Definition:
disassembler.h:44
AVR_OP_SBRS
@ AVR_OP_SBRS
Definition:
disassembler.h:103
AVR_OP_EICALL
@ AVR_OP_EICALL
Definition:
disassembler.h:56
AVR_OP_BRVC
@ AVR_OP_BRVC
Definition:
disassembler.h:35
AVR_OP_STD
@ AVR_OP_STD
Definition:
disassembler.h:116
AVR_OP_ELPM
@ AVR_OP_ELPM
Definition:
disassembler.h:58
AVR_OP_DES
@ AVR_OP_DES
Definition:
disassembler.h:55
AVR_OP_BST
@ AVR_OP_BST
Definition:
disassembler.h:37
AVR_OP_IN
@ AVR_OP_IN
Definition:
disassembler.h:65
AVR_OP_NEG
@ AVR_OP_NEG
Definition:
disassembler.h:83
AVR_OP_BLD
@ AVR_OP_BLD
Definition:
disassembler.h:17
AVR_OP_CALL
@ AVR_OP_CALL
Definition:
disassembler.h:38
AVR_OP_WDR
@ AVR_OP_WDR
Definition:
disassembler.h:122
AVR_OP_SUBI
@ AVR_OP_SUBI
Definition:
disassembler.h:119
AVR_OP_CLC
@ AVR_OP_CLC
Definition:
disassembler.h:40
AVR_OP_SLEEP
@ AVR_OP_SLEEP
Definition:
disassembler.h:113
AVR_OP_MULSU
@ AVR_OP_MULSU
Definition:
disassembler.h:82
AVR_OP_RCALL
@ AVR_OP_RCALL
Definition:
disassembler.h:90
AVR_OP_JMP
@ AVR_OP_JMP
Definition:
disassembler.h:67
AVROp
struct avr_opcode_t AVROp
sb
static SblHeader sb
Definition:
bin_mbn.c:26
ut16
uint16_t ut16
Definition:
demangler_util.h:30
ut32
uint32_t ut32
Definition:
demangler_util.h:31
size
voidpf void uLong size
Definition:
ioapi.h:138
ut8
uint8_t ut8
Definition:
lh5801.h:11
rz_types.h
rz_util.h
RzStrBuf
Definition:
rz_strbuf.h:10
avr_opcode_t
Definition:
disassembler.h:128
avr_opcode_t::size
ut16 size
Definition:
disassembler.h:133
avr_opcode_t::mask
ut16 mask
Definition:
disassembler.h:130
avr_opcode_t::param
ut16 param[4]
Definition:
disassembler.h:131
avr_opcode_t::cycles
ut16 cycles
Definition:
disassembler.h:132
avr_opcode_t::mnemonic
AVROpMnem mnemonic
Definition:
disassembler.h:129
buffer
Definition:
buffer.h:15
ut64
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
librz
asm
arch
avr
disassembler.h
Generated by
1.9.1