Skip to content

Commit

Permalink
Use the INSTR_DIRECTIVE macro (#16)
Browse files Browse the repository at this point in the history
Since the introduction of the `INSTR_DIRECTIVE` which does a check
for if a enumeration is a directive instruction or not by casting
it into a integer and comparing the values against the last instr-
uction; somehow, this if statement was lost during the migration
process (somewhere)
  • Loading branch information
cheng-alvin authored Dec 20, 2024
1 parent e908290 commit 6b4c123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libjas/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static buffer_t assemble(enum modes mode, instruction_t *instr_arr, size_t arr_s

/* -- Handle assembler directives -- */

if (instr_arr[i].instr > INSTR_SYSCALL) {
if (INSTR_DIRECTIVE(instr_arr[i].instr)) {
if (instr_arr[i].instr == INSTR_DIR_WRT_BUF) {
const buffer_t *data = (buffer_t *)instr_arr[i].operands[0].data;
buf_write(&buf, data->data, data->len);
Expand Down

0 comments on commit 6b4c123

Please sign in to comment.