1 #ifndef __ASSEMBLER_H__
2 #define __ASSEMBLER_H__
59 #define LC3AS_VAR extern
63 #define ERR_OPEN_READ "could not open '%s' for reading."
64 #define ERR_OPEN_WRITE "could not open '%s' for writing."
65 #define ERR_LINE_TOO_LONG "source line too long (max is %d)"
66 #define ERR_NO_ORIG "no .ORIG directive found"
67 #define ERR_MULTIPLE_ORIG "multiple .ORIG found"
68 #define ERR_NO_END "no .END directive found"
69 #define ERR_ORIG_NOT_1ST "instruction(s) appear before .ORIG"
70 #define ERR_END_NOT_LAST "instruction(s) appear after .END - ignored"
71 #define ERR_EXPECTED_COMMA "expected comma, got '%s'"
72 #define ERR_EXPECTED_REG "expected register (R0-R7), got '%s'"
73 #define ERR_EXPECT_REG_IMM "expected register or immediate, got '%s'"
74 #define ERR_BAD_LABEL "label '%s' contains illegal characters"
75 #define ERR_MISSING_OP "expected LC3 op, got '%s'"
76 #define ERR_MISSING_OPERAND "too few operand(s)"
77 #define ERR_EXTRA_OPERAND "extra operand(s) '%s'"
78 #define ERR_DUPLICATE_LABEL "label '%s' previously defined"
79 #define ERR_MISSING_LABEL "label '%s' never defined"
80 #define ERR_BAD_PCOFFSET "PCoffset to '%s' out of range"
81 #define ERR_BAD_IMM "immediate '%s' (bad format)"
82 #define ERR_IMM_TOO_BIG "immediate '%s' out of range"
83 #define ERR_EXPECTED_STR "expected quoted string, got '%s'"
84 #define ERR_BAD_STR "unterminated string '%s'"
85 #define ERR_EXPECTED_FILL "expected .FILL value, got '%s'"
86 #define ERR_BAD_CHAR_CONST "incorrect character constant \"%s\""
void asm_init(void)
Definition: assembler.c:71
int SR1
Definition: assembler.h:110
void asm_pass_two(const char *obj_file_name, line_info_t *list)
Definition: assembler.c:82
Defines the interface to symbol.c functions (do not modify)
#define LC3AS_VAR
Definition: assembler.h:59
void asm_print_line_info(line_info_t *info)
Definition: assembler.c:50
int lineNum
Definition: assembler.h:105
int address
Definition: assembler.h:106
line_info_t * asm_init_line_info(line_info_t *info)
Definition: assembler.c:31
opcode_t opcode
Definition: assembler.h:107
void asm_term(line_info_t *list)
Definition: assembler.c:86
char * reference
Definition: assembler.h:113
LC3AS_VAR int numErrors
Definition: assembler.h:89
line_info_t * asm_pass_one(const char *asm_file_name, const char *sym_file_name)
Definition: assembler.c:75
line_info_t * next
Definition: assembler.h:104
int DR
Definition: assembler.h:109
Definition: assembler.h:103
LC3AS_VAR int printPass1
Definition: assembler.h:92
inst_format_t * format
Definition: assembler.h:108
int immediate
Definition: assembler.h:112
definitions of the LC3 instruction set architecture (ISA) (do not modify)
int SR2
Definition: assembler.h:111
void asm_error(const char *msg,...)
Definition: assembler.c:60