v6502
The MOS 6502 Virtual Machine and Toolchain Infrastructure
Functions
Easy Symbol Table Interaction

Functions

as6502_tokenas6502_desymbolicateExpression (as6502_symbol_table *table, as6502_token *head, uint16_t offset, int caseSensitive)
 Automatically detects symbols in a given line, then dereferences them and replaces them with their actual addresses. More...
 
void as6502_symbolicateLine (as6502_symbol_table *table, char *line, size_t len, uint16_t offset)
 Searches for addresses in a given line and replaces them with their symbols in a given symbol table. More...
 

Detailed Description

Function Documentation

◆ as6502_desymbolicateExpression()

as6502_token* as6502_desymbolicateExpression ( as6502_symbol_table table,
as6502_token head,
uint16_t  offset,
int  caseSensitive 
)

Automatically detects symbols in a given line, then dereferences them and replaces them with their actual addresses.

Parameters
tableThe as6502_symbol_table to search
headThe as6502_token list to desymbolicate
offsetAddress of current line
caseSensitiveSymbol search case sensitivity (This argument is currently ignored, and it's always case sensitive)
Returns
A freshly malloc'ed, null terminated, string of length outLen, containing the desymbolicated line

FIXME: This needs to be smart about address formation, based on address mode This is absurdly inefficient, but works, given the current symbol table implementation

◆ as6502_symbolicateLine()

void as6502_symbolicateLine ( as6502_symbol_table table,
char *  line,
size_t  len,
uint16_t  offset 
)

Searches for addresses in a given line and replaces them with their symbols in a given symbol table.

Parameters
tableThe as6502_symbol_table to search
lineThe string to desymbolicate
lenUseable length of the line in chars
offsetAddress of current line