typedef unsigned char UBYTE; typedef char BYTE; typedef unsigned int UWORD; typedef int WORD; #define EXIST 0x00 // used as a parameter to access() #define MAX_FILENAME 13 #define TRUE 1 #define FALSE 0 #define MAX_INSTRUCTIONS 150 #define MAX_LINE 81 #define OK 0 #define ERROR 99 #define LINE_IS_COMMENT 1 #define LINE_IS_NOT_COMMENT 0 #define SPACE ' ' #define COMMENT_CHAR ';' // used for comments in asm source #define MAX_OPCODES 16 #define MAX_PSEUDOS 5 #define COMMA ',' #define R0 '0' #define R1 '1' #define R2 '2' #define R3 '3' #define ILLEGAL_REGISTER 100 #define ILLEGAL_OPCODE 101 #define ILLEGAL_INSTRUCTION 99 #define IMMEDIATE_MODE '#' #define MODE0 0 // direct addressing #define MODE1 1 // immediate addressing #define MODE2 2 // register addressing #define NEWLINE '\n' #define TAB '\t' #define SYMBOL_TERM ':' #define ASCII_TO_DEC 48 // subtract this from a character 0-9 to get it's decimal value #define LOC_CTR_START 0 // the location counter starts here #define HALT 99 // symbolizes end of program area, beginning of data #define SYMBOL_FOUND 1 // indicates a symbol (label :) was found #define ENDOFCODE 0xFF // used to symbolize the end of the instruction table or end of symbol table #define MEMORY_SIZE (MAX_INSTRUCTIONS + 100) // amount of memory used for Associative memory #define OPCODE_MASK 0xF0 #define MODE_MASK 0x0C #define REG_MASK 0x03