]> Shamusworld >> Repos - rmac/blob - symbol.h
Fix for reg keyword not working. Apparently it was renumbered (and unused) when the...
[rmac] / symbol.h
1 //
2 // RMAC - Reboot's Macro Assembler for all Atari computers
3 // SYMBOL.H - Symbol Handling
4 // Copyright (C) 199x Landon Dyer, 2011-2017 Reboot and Friends
5 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
6 // Source utilised with the kind permission of Landon Dyer
7 //
8
9 #ifndef __SYMBOL_H__
10 #define __SYMBOL_H__
11
12 #include <inttypes.h>
13
14 // Line lists
15 #define LLIST struct _llist
16 LLIST
17 {
18         LLIST * next;
19         uint8_t * line;
20 };
21
22 // Symbols
23 #define SYM struct _sym
24 SYM
25 {
26         SYM * snext;                    // * -> Next symbol on hash-chain
27         SYM * sorder;                   // * -> Next sym in order of reference
28         SYM * sdecl;                    // * -> Next sym in order of declaration
29         uint8_t stype;                  // Symbol type
30         uint16_t sattr;                 // Attribute bits
31         uint32_t sattre;                // Extended attribute bits
32         uint16_t senv;                  // Enviroment number
33         uint32_t svalue;                // Symbol value
34         uint8_t * sname;                // * -> Symbol's print-name
35         LLIST * lineList;               // * -> Macro's linked list of lines
36         LLIST * last;                   // * -> end of macro linked list
37         uint32_t uid;                   // Symbol's unique ID
38 };
39
40 // Exported variables
41 extern int curenv;
42 extern uint32_t firstglobal;// Index of the fist global symbol in an ELF object.
43
44 // Exported functions
45 SYM * lookup(uint8_t *, int, int);
46 void InitSymbolTable(void);
47 SYM * NewSymbol(uint8_t *, int, int);
48 void AddToSymbolDeclarationList(SYM *);
49 void ForceUndefinedSymbolsGlobal(void);
50 int symtable(void);
51 uint32_t sy_assign(uint8_t *, uint8_t *(*)());
52 uint32_t sy_assign_ELF(uint8_t *, uint8_t *(*)());
53 uint8_t * GetSymbolNameByUID(uint32_t);
54
55 #endif // __SYMBOL_H__
56