33 lines
652 B
C
33 lines
652 B
C
#ifndef LIB_65oo2_DECODER_H
|
|
# define LIB_65oo2_DECODER_H 1
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include "mnemonic.h"
|
|
#include "addressing.h"
|
|
|
|
typedef enum {
|
|
ADDRESS_SIZE_HINT_NONE, /* default 8bits */
|
|
ADDRESS_SIZE_HINT_16,
|
|
ADDRESS_SIZE_HINT_32,
|
|
|
|
ADDRESS_SIZE_HINT_MAX
|
|
} AddressSizeHint;
|
|
|
|
typedef enum {
|
|
OPERAND_SIZE_HINT_NONE,
|
|
OPERAND_SIZE_HINT_16,
|
|
OPERAND_SIZE_HINT_32,
|
|
|
|
OPERAND_SIZE_HINT_MAX
|
|
} OperandSizeHint;
|
|
|
|
typedef struct {
|
|
Mnemonic mnemonic;
|
|
uint8_t length;
|
|
AddressingMode addressing;
|
|
} DecodedInstruction;
|
|
|
|
int decoder_decode(uint8_t *buffer, size_t length, DecodedInstruction *instruction);
|
|
|
|
#endif /* !LIB_65oo2_DECODER_H */ |