s502 assembler
A very simple assembler for the 6502 line of processors written in C
src
token_t.h
Go to the documentation of this file.
1
#ifndef GUARD_TOKENTYPE
2
#define GUARD_TOKENTYPE
3
11
enum
{
13
TOKEN_BUFFER_SIZE
= 100,
15
TOKEN_SOURCE_FILE_SIZE
= 32,
16
};
17
18
#include "
instructions.h
"
19
#include "
addressmode.h
"
20
24
enum
tokenType
{
26
TT_INSTR
,
28
TT_DIRECTIVE
,
30
TT_LABEL
31
};
32
37
typedef
struct
{
39
int
binSize;
41
enum
tokenType
type;
43
struct
{
45
enum
AddressMode
addressmode;
47
int
number;
49
Instruction
* inst;
51
int
address;
52
} instr;
53
55
char
stripped[
TOKEN_BUFFER_SIZE
];
57
int
len
;
59
struct
{
61
char
fname[
TOKEN_SOURCE_FILE_SIZE
];
63
int
lineno;
64
} source;
65
}
Token
;
66
67
68
#endif
TT_INSTR
@ TT_INSTR
instruction token
Definition:
token_t.h:26
tokenType
tokenType
possible token types
Definition:
token_t.h:24
AddressMode
AddressMode
Possible address modes of an instruction.
Definition:
addressmode.h:10
TOKEN_SOURCE_FILE_SIZE
@ TOKEN_SOURCE_FILE_SIZE
source filename max length. Longer strings will get truncated.
Definition:
token_t.h:15
TOKEN_BUFFER_SIZE
@ TOKEN_BUFFER_SIZE
Token max length.
Definition:
token_t.h:13
Token
Token type to store token information.
Definition:
token_t.h:37
addressmode.h
AddressMode enum and related data.
TT_DIRECTIVE
@ TT_DIRECTIVE
directive token
Definition:
token_t.h:28
Instruction
linked list member holding instruction data
Definition:
instructions.h:25
TT_LABEL
@ TT_LABEL
label token
Definition:
token_t.h:30
instructions.h
Instruction data and related operations.
Token::len
int len
length of stripped text
Definition:
token_t.h:57
Generated by
1.8.20