s502 assembler
A very simple assembler for the 6502 line of processors written in C
directive.h
Go to the documentation of this file.
1 #ifndef GUARD_DIRECTIVE
2 #define GUARD_DIRECTIVE
3 
4 #include "tokenslist.h"
5 #include "state.h"
6 
19 enum DIRCommand {
21  DIR_STOP = -1,
23  DIR_NOP = 0,
30 };
31 
41 enum DIRCommand do_directive_token(State* s, TokensListElement* ptr, int skip);
42 
52 int directive_compile(State* s, Token* t, char** dataptr);
53 
54 #endif
DIR_STOP
@ DIR_STOP
An error occured, stop compilation.
Definition: directive.h:21
DIR_NOP
@ DIR_NOP
Nothing special, do nothing.
Definition: directive.h:23
State
Compiler pseudo-global state.
Definition: state.h:32
do_directive_token
enum DIRCommand do_directive_token(State *s, TokensListElement *ptr, int skip)
process a directive token
Definition: directive.c:362
DIR_ENDIF
@ DIR_ENDIF
An endif was encountered, should pop from state stack.
Definition: directive.h:29
Token
Token type to store token information.
Definition: token_t.h:37
tokenslist.h
Implement TokensList.
TokensListElement
An element of a TokensList.
Definition: tokenslist.h:16
DIRCommand
DIRCommand
Internal command type for directives.
Definition: directive.h:19
DIR_IF_FALSE
@ DIR_IF_FALSE
A conditional evaluated to false.
Definition: directive.h:27
DIR_IF_TRUE
@ DIR_IF_TRUE
A conditional evaluated to true.
Definition: directive.h:25
state.h
implement State class
directive_compile
int directive_compile(State *s, Token *t, char **dataptr)
Compile a directive into binary data.
Definition: directive.c:498