v6502
The MOS 6502 Virtual Machine and Toolchain Infrastructure
Macros | Functions
parser.h File Reference

Assembly language parsing. More...

#include <string.h>
#include <v6502/cpu.h>
#include <as6502/token.h>

Go to the source code of this file.

Macros

#define as6502_valueForToken(wide, token)   as6502_valueForString(wide, token->text, token->len)
 Returns the numeric value of a literal token regardless of base.
 

Functions

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.
 
v6502_address_mode as6502_addressModeForExpression (as6502_token *head)
 Returns the v6502_address_mode for a given (already lexed) expression by analyzing the operands.
 
int as6502_instructionLengthForAddressMode (v6502_address_mode mode)
 Returns the instruction length for a given v6502_address_mode. More...
 
void as6502_stringForAddressMode (char *out, v6502_address_mode mode)
 Returns the string representation of an v6502_address_mode.
 
uint16_t as6502_valueForString (int *wide, const char *string, size_t len)
 Returns the numeric value of a literal regardless of base.
 
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.
 
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.
 
void as6502_executeAsmLineOnCPU (v6502_cpu *cpu, const char *line, size_t len)
 Executes a symbol-free line of assembly on a specified v6502_cpu.
 
int as6502_isBranchInstruction (const char *string)
 Return YES if a given string reflects a branching instruction.
 
int as6502_isDigit (char c)
 Tests a single character for the possibility of being a hex/oct/dec digit.
 
int as6502_isNumber (const char *c)
 Determines whether or not a token is a number literal.
 

Detailed Description

Assembly language parsing.