s502 assembler
A very simple assembler for the 6502 line of processors written in C
tokenFunc.h
Go to the documentation of this file.
1 #ifndef GUARD_TOKEN
2 #define GUARD_TOKEN
3 
4 
5 #include "token_t.h"
6 #include "instructions.h"
7 #include "state.h"
8 
18 void token_print(Token* token);
19 
26 int token_recognize(Token* t);
27 
34 
43 int token_compile(State* s, Token* t, char** dataptr);
44 
52 int token_get_operand(State* s, Token* t);
53 
54 #endif
State
Compiler pseudo-global state.
Definition: state.h:32
Token::token_analyze_instruction
int token_analyze_instruction(State *s, Token *t)
analyze instruction token (instruction, addressmode & operand)
Definition: tokenFunc.c:224
Token
Token type to store token information.
Definition: token_t.h:37
token_t.h
token type struct
Token::token_print
void token_print(Token *token)
Pretty-print one token, with its source and length.
Definition: tokenFunc.c:20
instructions.h
Instruction data and related operations.
Token::token_recognize
int token_recognize(Token *t)
Parse token - test if it's an opcode, a label or a directive.
Definition: tokenFunc.c:251
Token::token_compile
int token_compile(State *s, Token *t, char **dataptr)
compile token into binary data
Definition: tokenFunc.c:318
Token::token_get_operand
int token_get_operand(State *s, Token *t)
parse the operand of the instruction as a number
Definition: tokenFunc.c:287
state.h
implement State class