26 #ifndef v6502_parser_h 27 #define v6502_parser_h 51 #define as6502_valueForToken(wide, token) as6502_valueForString(wide, token->text, token->len) An individual token which will often be a part of a linked list of tokens.
Definition: token.h:41
v6502_opcode as6502_opcodeForInstructionAndMode(as6502_token *instruction, v6502_address_mode mode)
Returns the v6502_opcode for a given instruction string at a specified v6502_address_mode.
Definition: parser.c:100
v6502_address_mode
Address Modes.
Definition: cpu.h:279
int as6502_isNumber(const char *c)
Determines whether or not a token is a number literal.
Definition: parser.c:756
Virtual CPU Object.
Definition: cpu.h:35
int as6502_isDigit(char c)
Tests a single character for the possibility of being a hex/oct/dec digit.
Definition: parser.c:747
int as6502_instructionLengthForAddressMode(v6502_address_mode mode)
Returns the instruction length for a given v6502_address_mode.
Definition: parser.c:877
v6502_address_mode as6502_addressModeForExpression(as6502_token *head)
Returns the v6502_address_mode for a given (already lexed) expression by analyzing the operands...
Definition: parser.c:782
void as6502_executeAsmLineOnCPU(v6502_cpu *cpu, const char *line, size_t len)
Executes a symbol-free line of assembly on a specified v6502_cpu.
Definition: parser.c:927
void as6502_instructionForExpression(uint8_t *opcode, uint8_t *low, uint8_t *high, v6502_address_mode *mode, as6502_token *head)
Completely parses a line of text to extract the instruction and v6502_address_mode.
Definition: parser.c:902
void as6502_byteValuesForString(uint8_t *high, uint8_t *low, int *wide, const char *string, size_t len)
Determines the numeric value of a literal separated into its high and low bytes.
Definition: parser.c:735
void as6502_stringForAddressMode(char *out, v6502_address_mode mode)
Returns the string representation of an v6502_address_mode.
Definition: parser.c:49
v6502_opcode
Instruction Set.
Definition: cpu.h:58
int as6502_isBranchInstruction(const char *string)
Return YES if a given string reflects a branching instruction.
Definition: parser.c:772
Tokenization functionality.
uint16_t as6502_valueForString(int *wide, const char *string, size_t len)
Returns the numeric value of a literal regardless of base.
Definition: parser.c:643