1.1 struct instruction

An instruction has the following structure:
 
struct instruction {
        int instr_type;
        union {
                char *lbl;
                struct mnemonic *mnm;
                struct directive *dir;
        } u;
        struct instruction *next;
};

instr_type

This member specifies the type of the instruction. Table 1.1 shows its values.
u
This member represents for one specific type of instruction. It can be a label definition, or a mnemonic (real or synthetic instruction), or a directive (pseudo-operation). Therefore, it is a union of three pointers, one to a string of label name, one to a mnemonic structure (see section 1.2), and the other to a directive structure (see section 1.6). Which member is active depends on the value of instr_type. Table 1.1 shows the rule.
next
This memeber points to the next instruction in the list.

Table 1.1 Instruction Types

Name
Value
Active Member in Union
Instruction Data Structure
LBL
0
u.lbl
a string of label name
MNM
1
u.mnm
a mnemonic structure 
DIR
2
u.dir
a directive structure

table of content