Olaf Seibert 7bbcbba5f5 Include undefined symbols in the symbol table for listing purposes.
MACRO11 V05.05 does this:

```
.MAIN.  MACRO V05.05  Sunday 18-APR-2021 16:29  Page 1

      1
      2 000000  012700  000000G                 mov #lab1,r0
      3
      4                                         .dsabl gbl
      5
U     6 000004  012700  000000                  mov #lab2,r0
      7
      8         000001                          .end

.MAIN.  MACRO V05.05  Sunday 18-APR-2021 16:29  Page 1-1
Symbol table

LAB1  = ****** GX       LAB2  = ******

. ABS.  000000    000   (RW,I,GBL,ABS,OVR)
        000010    001   (RW,I,LCL,REL,CON)
Errors detected:  1

*** Assembler statistics

Work  file  reads: 0
Work  file writes: 0
Size of work file: 34 Words  ( 1 Pages)
Size of core pool: 9260 Words  ( 35 Pages)
Operating  system: RSX-11M/M-PLUS

Elapsed time: 00:00:00.01
GBL,GBL/-SP=GBL
```
2021-05-30 13:19:39 +02:00

75 lines
1.6 KiB
C

#ifndef EXTREE__H
#define EXTREE__H
#include "symbols.h"
typedef struct ex_tree {
enum ex_type { EX_LIT = 1,
/* Expression is a literal value */
EX_SYM = 2,
/* Expression has a symbol reference */
EX_UNDEFINED_SYM = 3,
/* Expression is undefined sym reference */
EX_TEMP_SYM = 4,
/* Expression is temp sym reference */
EX_COM = 5,
/* One's complement */
EX_NEG = 6,
/* Negate */
EX_ERR = 7,
/* Expression with an error */
EX_ADD = 8,
/* Add */
EX_SUB = 9,
/* Subtract */
EX_MUL = 10,
/* Multiply */
EX_DIV = 11,
/* Divide */
EX_AND = 12,
/* bitwise and */
EX_OR = 13,
/* bitwise or */
EX_LSH = 14
/* left shift */
} type;
char *cp; /* points to end of parsed expression */
union {
struct {
struct ex_tree *left,
*right; /* Left, right children */
} child;
unsigned lit; /* Literal value */
SYMBOL *symbol; /* Symbol reference */
} data;
} EX_TREE;
EX_TREE *new_ex_tree(
void);
void free_tree(
EX_TREE *tp);
EX_TREE *new_ex_lit(
unsigned value);
EX_TREE *ex_err(
EX_TREE *tp,
char *cp);
EX_TREE *new_ex_bin(
int type,
EX_TREE *left,
EX_TREE *right);
EX_TREE *evaluate(
EX_TREE *tp,
int flags);
#define EVALUATE_DEFINEDNESS 1
#endif