git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@132 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
marcobaye 2020-05-02 11:28:15 +00:00
parent e3e68af762
commit 54defa1add
3 changed files with 19 additions and 23 deletions

View File

@ -358,6 +358,19 @@ static void get_symbol_value(scope_t scope, char optional_prefix_char, size_t na
}
// Parse program counter ('*')
static void parse_program_counter(void) // Now GotByte = "*"
{
struct number pc;
GetByte();
vcpu_read_pc(&pc);
// if needed, remember name for "undefined" error output
check_for_def(pc.flags, 0, "*", 1);
PUSH_INTOPERAND(pc.val.intval, pc.flags, pc.addr_refs);
}
// Parse quoted character.
// The character will be converted using the current encoding.
static void parse_quoted_character(char closing_quote)
@ -572,20 +585,6 @@ static void parse_octal_value(void) // Now GotByte = "&"
}
// Parse program counter ('*')
// FIXME - this function is similar to symbol lookup, so move it there
static void parse_program_counter(void) // Now GotByte = "*"
{
struct number pc;
GetByte();
vcpu_read_pc(&pc);
// if needed, remember name for "undefined" error output
check_for_def(pc.flags, 0, "*", 1);
PUSH_INTOPERAND(pc.val.intval, pc.flags, pc.addr_refs);
}
// Parse function call (sin(), cos(), arctan(), ...)
static void parse_function_call(void)
{

View File

@ -18,14 +18,11 @@
// Constants
const char FILE_READBINARY[] = "rb";
#define CHAR_TAB (9) // Tab character
#define CHAR_LF (10) // line feed (in file)
// (10) // start of line (in high-level format)
#define CHAR_CR (13) // carriage return (in file)
// (13) // end of file (in high-level format)
#define CHAR_STATEMENT_DELIMITER ':'
#define CHAR_COMMENT_SEPARATOR ';'
// if the characters above are changed, don't forget to adjust ByteFlags[]!
// if the characters above are changed, don't forget to adjust byte_flags[]!
// fake input structure (for error msgs before any real input is established)
static struct input outermost = {
@ -149,7 +146,7 @@ static char get_processed_from_file(void)
// check special characters ("0x00 TAB LF CR SPC / : ; }")
switch (from_file) {
case CHAR_TAB: // TAB character
case '\t':
case ' ':
// remember to skip all following blanks
Input_now->state = INPUTSTATE_SKIPBLANKS;
@ -181,12 +178,12 @@ static char get_processed_from_file(void)
}
// it's really "//", so act as if ';'
/*FALLTHROUGH*/
case CHAR_COMMENT_SEPARATOR:
case ';':
// remember to skip remainder of line
Input_now->state = INPUTSTATE_COMMENT;
return CHAR_EOS; // end of statement
case CHAR_STATEMENT_DELIMITER:
case ':': // statement delimiter
// just deliver an EOS instead
return CHAR_EOS; // end of statement
@ -200,7 +197,7 @@ static char get_processed_from_file(void)
do {
from_file = getc(Input_now->src.fd);
IF_WANTED_REPORT_SRCCHAR(from_file);
} while ((from_file == CHAR_TAB) || (from_file == ' '));
} while ((from_file == '\t') || (from_file == ' '));
// re-process last byte
Input_now->state = INPUTSTATE_AGAIN;
break;

View File

@ -559,7 +559,7 @@ static enum eos po_pseudopc(void)
new_offset = (new_pc_result.val.intval - CPU_state.pc.val.intval) & 0xffff;
CPU_state.pc.val.intval = new_pc_result.val.intval;
CPU_state.pc.flags |= NUMBER_IS_DEFINED; // FIXME - remove when allowing undefined!
// TODO - accept ", name=SECTIONNAME"
// TODO - accept ', name = "section name"'
// if there's a block, parse that and then restore old value!
if (Parse_optional_block()) {
// restore old