* © 2018 Aaron Taylor <ataylor at subgeniuskitty dot com>
* See LICENSE.txt file for copyright and license details.
#ifndef NEDASM_STRUCTURES_H
#define NEDASM_STRUCTURES_H
/* This enumeration is slightly misnamed since, in addition to syllables, it also includes WORD. */
/* And now includes LABELs, not even a real instruction. TODO: Fix either the name or purpose. */
/* Manually assign values so that 0 remains unassigned, use for uninitialized value. */
/* Pointer to previous entry in list. NULL indicates start of list. */
struct instruction
* prev
;
/* Pointer to next entry in list. NULL indicates end of list. */
struct instruction
* next
;
/* Line number of the source file in which this instruction was commanded. */
/* Specifies the type of instruction this struct represents. */
/* Contains data value for instructions containing embedded data. */
/* (WORD_x, IM_x, LDSP+x, STSP+x, etc) */
/* Stores the target label string for instructions that alter PC. */
/* NULL if the address to jump to was already placed on TOS by other instructions. */
/* Stores the label name if this instruction is a label target. */
/* Address in RAM of this instruction. Generated during assembly as an offset. */
struct instruction
* create_instruction_struct(void);
struct instruction
* seek_instruction_list_start(struct instruction
* instructions
);
struct instruction
* seek_instruction_list_end(struct instruction
* instructions
);
void insert_NOP_structs_after(struct instruction
* list
, uint8_t count
);
void insert_NOP_structs_before(struct instruction
* list
, uint8_t count
);
struct instruction
* remove_instruction_struct(struct instruction
* instructions
);