#include typedef enum ltype {BLANK, COMMENT, DEFINE, LABEL, COMMAND_OPER, COMMAND_NOOPER, ILLEGAL, ADDRESS, AT_ADDRESS, DFB, DFW, DFL, DFM} LineType; typedef enum addtype {LAB, IMM, ABS, ZP, INDX, INDY, ZPX, ABSX, ABSY, IND, ACC, REL, IMP, ZPY} AddressingType; typedef struct optype { char orig[80]; char formatted[80]; char label[80]; long value; AddressingType addtype; char addtype_text[20]; } OperandType; typedef struct label_node { char name[30]; long value; struct label_node *next; } Label_Node; typedef struct command_node { char name[4]; unsigned char modes[14]; struct command_node *next; } Command_Node; /* link.c */ Label_Node *create_label_list(); Command_Node *create_mnemonic_list(); void add_label_element(Label_Node *node, char [], long value); void add_mnemonic_element(Command_Node *node, char [], unsigned char *mode); long find_label_element(Label_Node *node, char []); unsigned char *find_mnemonic_element(Command_Node *node, char []); /* formatop.c */ OperandType format_operand (OperandType operand, Label_Node *, int, int); int get_value (OperandType *, char string[], Label_Node *, int, int); /* Branch.c */ void do_branch (long, OperandType *, Label_Node *, int, int); /* interpret.c */ void interpret (unsigned char *, OperandType *, AddressingType, long, unsigned char[]); /* preload.c */ void read_mnemonics(char *, Command_Node *); void read_labels(char *, Label_Node *); /* Assemble.c */ int assemble (FILE *, long *, long *, long, int, int, unsigned char *, Label_Node *, Command_Node *); /* Main.c */ int do_labels (Label_Node *, char[], long); LineType GetLineType (char [], char[], char, int); int getline(char [], int); void print_info (OperandType, int, long, char[], unsigned char[]); void print_hex (long, unsigned char *, int); char getfirstchar (char[]); void showhelp();