comparison src/lwasm.h @ 21:3c0e5f311c95

Added reading of input file for pass1
author lost
date Fri, 02 Jan 2009 00:43:06 +0000
parents 05d4115b4860
children d2e86babd958
comparison
equal deleted inserted replaced
20:610710a7859f 21:3c0e5f311c95
24 #ifndef __lwasm_h_seen__ 24 #ifndef __lwasm_h_seen__
25 #define __lwasm_h_seen__ 25 #define __lwasm_h_seen__
26 26
27 #define OUTPUT_DECB 0 // DECB multirecord format 27 #define OUTPUT_DECB 0 // DECB multirecord format
28 #define OUTPUT_RAW 1 // raw sequence of bytes 28 #define OUTPUT_RAW 1 // raw sequence of bytes
29 #define OUTPUT_RAWREL 2 // raw but with ORG as a relative offset 29 #define OUTPUT_OBJ 2 // proprietary object file format
30 #define OUTPUT_OBJ 3 // proprietary object file format 30
31 // structure for keeping track of lines
32 typedef struct lwasm_line_s lwasm_line_t;
33 struct lwasm_line_s {
34 char *text; // the actual text of the line
35 int lineno; // line number within the file
36 char *filename; // file name reference
37 lwasm_line_t *next; // next line
38 lwasm_line_t *prev; // previous line
39 };
31 40
32 // keep track of current assembler state 41 // keep track of current assembler state
33 typedef struct { 42 typedef struct {
34 int dpval; // current dp value (setdp) 43 int dpval; // current dp value (setdp)
35 int addr; // current address 44 int addr; // current address
36 int errorcount; // error count 45 int errorcount; // error count
37 int passnum; // which pass are we on? 46 int passnum; // which pass are we on?
47 int execaddr; // execution address for the program (END ....)
48 int pragmas; // what pragmas are in effect?
49
50 lwasm_line_t *lineshead; // first line of source code
51 lwasm_line_t *linestail; // last line of source code
52
38 const char *infile; // input file 53 const char *infile; // input file
39 const char *outfile; // output file 54 const char *outfile; // output file
40 const char *listfile; // output listing file 55 const char *listfile; // output listing file
41 int debug; // debug mode 56 int debug; // debug mode
42 int outformat; // output format type 57 int outformat; // output format type
43 int execaddr; // execution address for the program (END ....) 58 char **filelist; // files that have been read
44 int pragmas; // what pragmas are in effect? 59 int filelistlen; // number of files in the list
45 } asmstate_t; 60 } asmstate_t;
46 61
47 #define PRAGMA_NOINDEX0TONONE 1 62 #define PRAGMA_NOINDEX0TONONE 1
48 63
49 #ifndef __symtab_c_seen__ 64 #ifndef __symtab_c_seen__