Rizin
unix-like reverse engineering framework and cli tools
lh5801.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2014 Jonathan Neuschäfer
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 /*
5  * This disassembler is based on the "SHARP PC-1500/A Systemhandbuch"
6  * (system manual) as published by Günter Holtkötter GmbH.
7  */
8 
9 #include <stdint.h>
10 #include <stdlib.h>
11 typedef uint8_t ut8;
12 
13 /* Instruction classes. That's for example "add with carry". */
84 
86 };
87 
88 /* Instruction description. */
90  char mnem[4]; /* Assembler mnemonic */
91  const char *desc; /* Textual description (for ?d) */
92 
93  /* TODO: rizin insn type? */
94 };
95 
96 const struct lh5801_insn_class_desc
98 
99 /* A decoded instruction */
100 struct lh5801_insn {
101  ut8 iclass; /* an index into lh5801_insn_class_descs */
102  ut8 type; /* an index into lh5801_insn_descs */
105  ut8 imm[3];
106 };
107 
108 int lh5801_decode(struct lh5801_insn *, const uint8_t *, int);
109 void lh5801_print_insn(char *out, int size, const struct lh5801_insn *);
const lzma_allocator const uint8_t size_t uint8_t * out
Definition: block.h:528
voidpf void uLong size
Definition: ioapi.h:138
const struct lh5801_insn_class_desc lh5801_insn_class_descs[LH5801_INSNC_NUMBER]
Definition: lh5801.h:96
int lh5801_decode(struct lh5801_insn *, const uint8_t *, int)
Definition: lh5801.c:674
void lh5801_print_insn(char *out, int size, const struct lh5801_insn *)
Definition: lh5801.c:792
lh5801_insn_class
Definition: lh5801.h:14
@ LH5801_INSNC_DCS
Definition: lh5801.h:21
@ LH5801_INSNC_PSH
Definition: lh5801.h:43
@ LH5801_INSNC_TIN
Definition: lh5801.h:47
@ LH5801_INSNC_ADC
Definition: lh5801.h:15
@ LH5801_INSNC_SPU
Definition: lh5801.h:60
@ LH5801_INSNC_POP
Definition: lh5801.h:44
@ LH5801_INSNC_RPV
Definition: lh5801.h:63
@ LH5801_INSNC_CPA
Definition: lh5801.h:30
@ LH5801_INSNC_SIE
Definition: lh5801.h:67
@ LH5801_INSNC_ATP
Definition: lh5801.h:59
@ LH5801_INSNC_BIT
Definition: lh5801.h:32
@ LH5801_INSNC_TTA
Definition: lh5801.h:46
@ LH5801_INSNC_AM1
Definition: lh5801.h:70
@ LH5801_INSNC_AM0
Definition: lh5801.h:69
@ LH5801_INSNC_DEC
Definition: lh5801.h:29
@ LH5801_INSNC_NUMBER
Definition: lh5801.h:85
@ LH5801_INSNC_JMP
Definition: lh5801.h:74
@ LH5801_INSNC_RTN
Definition: lh5801.h:82
@ LH5801_INSNC_SPV
Definition: lh5801.h:62
@ LH5801_INSNC_REC
Definition: lh5801.h:57
@ LH5801_INSNC_LDI
Definition: lh5801.h:37
@ LH5801_INSNC_SDE
Definition: lh5801.h:40
@ LH5801_INSNC_DCA
Definition: lh5801.h:17
@ LH5801_INSNC_BCH
Definition: lh5801.h:75
@ LH5801_INSNC_RIE
Definition: lh5801.h:68
@ LH5801_INSNC_LOP
Definition: lh5801.h:77
@ LH5801_INSNC_ATT
Definition: lh5801.h:45
@ LH5801_INSNC_LIN
Definition: lh5801.h:36
@ LH5801_INSNC_VMJ
Definition: lh5801.h:80
@ LH5801_INSNC_VCC
Definition: lh5801.h:81
@ LH5801_INSNC_ANI
Definition: lh5801.h:23
@ LH5801_INSNC_SBI
Definition: lh5801.h:20
@ LH5801_INSNC_DRR
Definition: lh5801.h:54
@ LH5801_INSNC_CIN
Definition: lh5801.h:48
@ LH5801_INSNC_LDE
Definition: lh5801.h:35
@ LH5801_INSNC_SJP
Definition: lh5801.h:78
@ LH5801_INSNC_OFF
Definition: lh5801.h:73
@ LH5801_INSNC_ITA
Definition: lh5801.h:66
@ LH5801_INSNC_RDP
Definition: lh5801.h:65
@ LH5801_INSNC_STA
Definition: lh5801.h:39
@ LH5801_INSNC_LDA
Definition: lh5801.h:34
@ LH5801_INSNC_ORA
Definition: lh5801.h:24
@ LH5801_INSNC_SEC
Definition: lh5801.h:56
@ LH5801_INSNC_AND
Definition: lh5801.h:22
@ LH5801_INSNC_SDP
Definition: lh5801.h:64
@ LH5801_INSNC_RTI
Definition: lh5801.h:83
@ LH5801_INSNC_HLT
Definition: lh5801.h:72
@ LH5801_INSNC_VEJ
Definition: lh5801.h:79
@ LH5801_INSNC_ROR
Definition: lh5801.h:50
@ LH5801_INSNC_ADI
Definition: lh5801.h:16
@ LH5801_INSNC_ADR
Definition: lh5801.h:18
@ LH5801_INSNC_ROL
Definition: lh5801.h:49
@ LH5801_INSNC_CPI
Definition: lh5801.h:31
@ LH5801_INSNC_ORI
Definition: lh5801.h:25
@ LH5801_INSNC_SBC
Definition: lh5801.h:19
@ LH5801_INSNC_LDX
Definition: lh5801.h:38
@ LH5801_INSNC_INC
Definition: lh5801.h:28
@ LH5801_INSNC_SIN
Definition: lh5801.h:41
@ LH5801_INSNC_EAI
Definition: lh5801.h:27
@ LH5801_INSNC_SHL
Definition: lh5801.h:51
@ LH5801_INSNC_NOP
Definition: lh5801.h:71
@ LH5801_INSNC_AEX
Definition: lh5801.h:55
@ LH5801_INSNC_SHR
Definition: lh5801.h:52
@ LH5801_INSNC_BII
Definition: lh5801.h:33
@ LH5801_INSNC_DRL
Definition: lh5801.h:53
@ LH5801_INSNC_BCC
Definition: lh5801.h:76
@ LH5801_INSNC_EOR
Definition: lh5801.h:26
@ LH5801_INSNC_CDV
Definition: lh5801.h:58
@ LH5801_INSNC_STX
Definition: lh5801.h:42
@ LH5801_INSNC_RPU
Definition: lh5801.h:61
uint8_t ut8
Definition: lh5801.h:11
unsigned char uint8_t
Definition: sftypes.h:31
const char * desc
Definition: lh5801.h:91
ut8 fd
Definition: lh5801.h:103
ut8 type
Definition: lh5801.h:102
ut8 opcode
Definition: lh5801.h:104
ut8 iclass
Definition: lh5801.h:101
ut8 imm[3]
Definition: lh5801.h:105