Add more values to the ast to facilitate encoding

- Add a instruction value that contains the encoding, the address and a
  flag to indicate if this instruction contains label references
- Add label value that contains an address
- Add reference value that contains offset, an absolute address and an
  operand size
- define types for all value options in the union
- define accessor functions for all the values in the union
This commit is contained in:
2025-04-18 12:30:51 +02:00
parent 0acc3f27f3
commit 5272fdb227
3 changed files with 50 additions and 5 deletions

View File

@ -88,7 +88,8 @@ error_t *print_encoding(tokenlist_t *list) {
if (node->id != NODE_INSTRUCTION)
continue;
print_hex(node->value.encoding.len, node->value.encoding.encoding);
print_hex(node->value.instruction.encoding.len,
node->value.instruction.encoding.buffer);
}
encoder_free(encoder);