65oo2/lib/decoder.h

33 lines
652 B
C
Raw Normal View History

2024-04-12 13:35:39 +00:00
#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 */