Rizin
unix-like reverse engineering framework and cli tools
pic_midrange.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2018 courk <courk@courk.cc>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef PIC_MIDRANGE_H
5 #define PIC_MIDRANGE_H
6 
7 #include <rz_asm.h>
8 #include <rz_types.h>
9 
10 typedef enum {
23 
24 #define PIC_MIDRANGE_OP_ARGS_2F_MASK_F 0x3
25 #define PIC_MIDRANGE_OP_ARGS_7F_MASK_F 0x7f
26 #define PIC_MIDRANGE_OP_ARGS_1D_7F_MASK_D (1 << 7)
27 #define PIC_MIDRANGE_OP_ARGS_1D_7F_MASK_F 0x7f
28 #define PIC_MIDRANGE_OP_ARGS_1N_6K_MASK_N (1 << 6)
29 #define PIC_MIDRANGE_OP_ARGS_1N_6K_MASK_K 0x3f
30 #define PIC_MIDRANGE_OP_ARGS_3B_7F_MASK_B (0x7 << 7)
31 #define PIC_MIDRANGE_OP_ARGS_3B_7F_MASK_F 0x7f
32 #define PIC_MIDRANGE_OP_ARGS_4K_MASK_K 0xf
33 #define PIC_MIDRANGE_OP_ARGS_8K_MASK_K 0xff
34 #define PIC_MIDRANGE_OP_ARGS_9K_MASK_K 0x1ff
35 #define PIC_MIDRANGE_OP_ARGS_11K_MASK_K 0x7ff
36 #define PIC_MIDRANGE_OP_ARGS_1N_2M_MASK_N (1 << 2)
37 #define PIC_MIDRANGE_OP_ARGS_1N_2M_MASK_M 0x3
38 
39 typedef struct _pic_midrange_op {
40  const char *mnemonic;
43 
44 typedef enum {
99 
102 int pic_midrange_disassemble(RzAsmOp *op, char *opbuf, const ut8 *b, int l);
103 
104 #endif // PIC_MIDRANGE_H
uint16_t ut16
uint8_t ut8
Definition: lh5801.h:11
struct _pic_midrange_op PicMidrangeOpInfo
PicMidrangeOpcode
Definition: pic_midrange.h:44
@ PIC_MIDRANGE_OPCODE_ADDWFC
Definition: pic_midrange.h:91
@ PIC_MIDRANGE_OPCODE_TRIS
Definition: pic_midrange.h:51
@ PIC_MIDRANGE_OPCODE_DECFSZ
Definition: pic_midrange.h:63
@ PIC_MIDRANGE_OPCODE_MOVLW
Definition: pic_midrange.h:74
@ PIC_MIDRANGE_OPCODE_RETFIE
Definition: pic_midrange.h:47
@ PIC_MIDRANGE_OPCODE_BCF
Definition: pic_midrange.h:68
@ PIC_MIDRANGE_OPCODE_INVALID
Definition: pic_midrange.h:97
@ PIC_MIDRANGE_OPCODE_MOVLP
Definition: pic_midrange.h:93
@ PIC_MIDRANGE_OPCODE_NOP
Definition: pic_midrange.h:45
@ PIC_MIDRANGE_OPCODE_MOVLB
Definition: pic_midrange.h:86
@ PIC_MIDRANGE_OPCODE_INCFSZ
Definition: pic_midrange.h:67
@ PIC_MIDRANGE_OPCODE_COMF
Definition: pic_midrange.h:61
@ PIC_MIDRANGE_OPCODE_ANDLW
Definition: pic_midrange.h:77
@ PIC_MIDRANGE_OPCODE_SUBWF
Definition: pic_midrange.h:54
@ PIC_MIDRANGE_OPCODE_IORWF
Definition: pic_midrange.h:56
@ PIC_MIDRANGE_OPCODE_RLF
Definition: pic_midrange.h:65
@ PIC_MIDRANGE_OPCODE_MOVIW_2
Definition: pic_midrange.h:95
@ PIC_MIDRANGE_OPCODE_BRW
Definition: pic_midrange.h:83
@ PIC_MIDRANGE_OPCODE_MOVF
Definition: pic_midrange.h:60
@ PIC_MIDRANGE_OPCODE_OPTION
Definition: pic_midrange.h:48
@ PIC_MIDRANGE_OPCODE_RETLW
Definition: pic_midrange.h:75
@ PIC_MIDRANGE_OPCODE_CLR
Definition: pic_midrange.h:53
@ PIC_MIDRANGE_OPCODE_MOVWI_2
Definition: pic_midrange.h:96
@ PIC_MIDRANGE_OPCODE_MOVWF
Definition: pic_midrange.h:52
@ PIC_MIDRANGE_OPCODE_ASRF
Definition: pic_midrange.h:89
@ PIC_MIDRANGE_OPCODE_ADDLW
Definition: pic_midrange.h:80
@ PIC_MIDRANGE_OPCODE_BTFSC
Definition: pic_midrange.h:70
@ PIC_MIDRANGE_OPCODE_BSF
Definition: pic_midrange.h:69
@ PIC_MIDRANGE_OPCODE_LSRF
Definition: pic_midrange.h:88
@ PIC_MIDRANGE_OPCODE_SUBLW
Definition: pic_midrange.h:79
@ PIC_MIDRANGE_OPCODE_BTFSS
Definition: pic_midrange.h:71
@ PIC_MIDRANGE_OPCODE_SWAPF
Definition: pic_midrange.h:66
@ PIC_MIDRANGE_OPCODE_LSLF
Definition: pic_midrange.h:87
@ PIC_MIDRANGE_OPCODE_CLRWDT
Definition: pic_midrange.h:50
@ PIC_MIDRANGE_OPCODE_INCF
Definition: pic_midrange.h:62
@ PIC_MIDRANGE_OPCODE_SUBWFB
Definition: pic_midrange.h:90
@ PIC_MIDRANGE_OPCODE_CALL
Definition: pic_midrange.h:72
@ PIC_MIDRANGE_OPCODE_MOVIW_1
Definition: pic_midrange.h:84
@ PIC_MIDRANGE_OPCODE_ADDWF
Definition: pic_midrange.h:59
@ PIC_MIDRANGE_OPCODE_RETURN
Definition: pic_midrange.h:46
@ PIC_MIDRANGE_OPCODE_ADDFSR
Definition: pic_midrange.h:92
@ PIC_MIDRANGE_OPCODE_XORWF
Definition: pic_midrange.h:58
@ PIC_MIDRANGE_OPCODE_RESET
Definition: pic_midrange.h:81
@ PIC_MIDRANGE_OPCODE_GOTO
Definition: pic_midrange.h:73
@ PIC_MIDRANGE_OPCODE_MOVWI_1
Definition: pic_midrange.h:85
@ PIC_MIDRANGE_OPCODE_IORLW
Definition: pic_midrange.h:76
@ PIC_MIDRANGE_OPCODE_ANDWF
Definition: pic_midrange.h:57
@ PIC_MIDRANGE_OPCODE_CALLW
Definition: pic_midrange.h:82
@ PIC_MIDRANGE_OPCODE_XORLW
Definition: pic_midrange.h:78
@ PIC_MIDRANGE_OPCODE_DECF
Definition: pic_midrange.h:55
@ PIC_MIDRANGE_OPCODE_SLEEP
Definition: pic_midrange.h:49
@ PIC_MIDRANGE_OPCODE_RRF
Definition: pic_midrange.h:64
@ PIC_MIDRANGE_OPCODE_BRA
Definition: pic_midrange.h:94
const PicMidrangeOpInfo * pic_midrange_get_op_info(PicMidrangeOpcode opcode)
Definition: pic_midrange.c:152
int pic_midrange_disassemble(RzAsmOp *op, char *opbuf, const ut8 *b, int l)
Definition: pic_midrange.c:159
PicMidrangeOpArgs
Definition: pic_midrange.h:10
@ PIC_MIDRANGE_OP_ARGS_11K
Definition: pic_midrange.h:20
@ PIC_MIDRANGE_OP_ARGS_2F
Definition: pic_midrange.h:12
@ PIC_MIDRANGE_OP_ARGS_4K
Definition: pic_midrange.h:17
@ PIC_MIDRANGE_OP_ARGS_1D_7F
Definition: pic_midrange.h:14
@ PIC_MIDRANGE_OP_ARGS_9K
Definition: pic_midrange.h:19
@ PIC_MIDRANGE_OP_ARGS_1N_6K
Definition: pic_midrange.h:15
@ PIC_MIDRANGE_OP_ARGS_8K
Definition: pic_midrange.h:18
@ PIC_MIDRANGE_OP_ARGS_1N_2M
Definition: pic_midrange.h:21
@ PIC_MIDRANGE_OP_ARGS_NONE
Definition: pic_midrange.h:11
@ PIC_MIDRANGE_OP_ARGS_3B_7F
Definition: pic_midrange.h:16
@ PIC_MIDRANGE_OP_ARGS_7F
Definition: pic_midrange.h:13
PicMidrangeOpcode pic_midrange_get_opcode(ut16 instr)
Definition: pic_midrange.c:65
#define b(i)
Definition: sha256.c:42
const char * mnemonic
Definition: pic_midrange.h:40
PicMidrangeOpArgs args
Definition: pic_midrange.h:41
Definition: dis.c:32