s502 assembler
A very simple assembler for the 6502 line of processors written in C
|
implement number module functions More...
Go to the source code of this file.
Functions | |
int | number_char_to_digit (char c) |
Convert a hex char to a digit. More... | |
int | number_parse_number (char *str) |
interpret a string as a decimal or hex number More... | |
int | number_get_raw (State *s, char *str) |
interpret number without modifiers More... | |
int | number_get_number (State *s, char *str) |
interpret a string as a constant, label or number More... | |
implement number module functions
Definition in file number.c.
int number_char_to_digit | ( | char | c | ) |
Convert a hex char to a digit.
c | char to convert |
Handles upper or lowercase chars
Returns NUMBER_ERROR on failed conversion
Definition at line 12 of file number.c.
References NUMBER_ERROR.
Referenced by instruction_load(), and number_parse_number().
int number_get_number | ( | State * | s, |
char * | str | ||
) |
interpret a string as a constant, label or number
s | State to read constant / label values from |
str | string to interpret |
Definition at line 75 of file number.c.
References number_get_raw().
Referenced by compile_data(), compile_pad(), and token_get_operand().
int number_get_raw | ( | State * | s, |
char * | str | ||
) |
interpret number without modifiers
s | state to read from |
str | string to interpret |
Resolves labels & constants, parses numbers
Does not interpret modifiers
Definition at line 62 of file number.c.
References State::defines, State::labels, Map::map_get(), NUMBER_ERROR, NUMBER_LABEL_NODEF, and number_parse_number().
Referenced by number_get_number().
int number_parse_number | ( | char * | str | ) |
interpret a string as a decimal or hex number
str | string to interpret |
This one only parses decimals and hexes without any modifiers
Definition at line 30 of file number.c.
References ERROR, number_char_to_digit(), and NUMBER_ERROR.
Referenced by number_get_raw().