+/* instructions have operands */
+struct operand_ {
+ struct operand_ *next;
+ char *operand; /* tokenized operand text */
+};
+
+/* keep an array of instructions as we read them in */
+struct instruction_ {
+ char *label; /* set if a label points here */
+ char *opcode; /* tokenized instruction text */
+ struct operand_ *operands; /* list of operands */
+ unsigned int ready : 1; /* bytecode computed? */
+ unsigned int length; /* number of words of bytecode */
+ DCPU16_WORD instr_words[];
+};
+
+/* keep an array of labels, indexed back to their instruction locations */
+struct label_ {
+ char *label; /* name of label */
+ struct instruction_ **instr; /* pointer into array of instructions */
+ unsigned int ready : 1; /* do we know where this label is yet? */
+ DCPU16_WORD addr;
+};
+
+
+/* routines to support generic grow-able arrays */
+
+struct dynamic_array_ {
+ size_t entry_size;
+ size_t grow_size;
+ size_t allocated;
+ size_t entries;
+ void *a;
+};
+
+#define DYNARRAY_ITEM(da, index) ( (char *)(da).a + ( (da).entry_size * index ) )
+
+/* allocate and initialize a new generic dynamic array */