pokeheartgold/tools/elfcoder/instruction.h
taxicat1 008118b6b3 Address review comments
- all local vars to camelcase
- header include guards with lib name
- comments for preprocessor directives
- asm defs back to respective .inc files
- /lib/dsprot/tools/ merged to /tools/
- unprefixed globals prefixed
- sdk defs consolidated to sdk include
- lsf lib split to objects
2025-11-09 02:59:34 -05:00

25 lines
594 B
C

#ifndef INSTRUCTION_H
#define INSTRUCTION_H
#include <stdint.h>
#include <stdio.h>
typedef struct {
unsigned int operands : 24;
unsigned int opcode : 8;
} Instruction;
void Instructions_Read(Instruction *dst, unsigned int count, FILE *src);
void Instructions_Write(Instruction *src, unsigned int count, FILE *dst);
static inline uint32_t Instruction_GetFull(Instruction *dst) {
return (dst->opcode << 24) | dst->operands;
}
static inline void Instruction_SetFull(Instruction *dst, uint32_t full) {
dst->opcode = full >> 24;
dst->operands = full & 0x00FFFFFF;
}
#endif