|
s502 assembler
A very simple assembler for the 6502 line of processors written in C
|
implement processing steps 2-3 More...
#include "debugmalloc.h"#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <string.h>#include "state.h"#include "pass_twothree.h"#include "tokenFunc.h"#include "logging.h"Go to the source code of this file.
Functions | |
| int | pass_two (State *s) |
| compilation pass 2 More... | |
| char * | concat_bin (State *s, int *n) |
| compile tokens and concat binary data More... | |
| int | write_data (State *s) |
| compilation pass 3 More... | |
| char* concat_bin | ( | State * | s, |
| int * | n | ||
| ) |
compile tokens and concat binary data
| n | pointer to return length of binary data to |
| s | assembler state |
The resulting buffer should be freed by the caller!
Definition at line 42 of file pass_twothree.c.
References TokensList::head, TokensListElement::next, Token::token_compile(), and State::tokens.
Referenced by write_data().
| int pass_two | ( | State * | s | ) |
compilation pass 2
| s | current state |
Simply subtitutes remaining operand values (forward labels).
Definition at line 19 of file pass_twothree.c.
References ERROR, FAIL, TokensList::head, TokensListElement::next, Token::token_get_operand(), Token::token_print(), State::tokens, and TT_INSTR.
Referenced by main().
| int write_data | ( | State * | s | ) |
compilation pass 3
| s | current state |
Writes binary data to file
Definition at line 69 of file pass_twothree.c.
References concat_bin(), ERROR, FAIL, and State::outfile.
Referenced by main().