mirror of
https://github.com/uffejakobsen/acme.git
synced 2025-04-09 11:37:02 +00:00
fixed bug where labels could be used before pc definition,
added test files. git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@344 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
parent
08dad45efb
commit
2e2eb5e60c
@ -321,7 +321,7 @@ static void is_not_defined(struct symbol *optional_symbol, char *name, size_t le
|
||||
}
|
||||
|
||||
dynabuf_clear(errormsg_dyna_buf);
|
||||
dynabuf_add_string(errormsg_dyna_buf, "Value not defined (");
|
||||
dynabuf_add_string(errormsg_dyna_buf, "Symbol not defined (");
|
||||
length += errormsg_dyna_buf->size;
|
||||
|
||||
dynabuf_add_string(errormsg_dyna_buf, name);
|
||||
@ -385,6 +385,7 @@ static void get_symbol_value(scope_t scope, size_t name_length, unsigned int unp
|
||||
static void parse_program_counter(unsigned int unpseudo_count) // Now GotByte = "*"
|
||||
{
|
||||
struct number pc;
|
||||
struct object *arg;
|
||||
|
||||
GetByte();
|
||||
vcpu_read_pc(&pc);
|
||||
@ -393,7 +394,10 @@ static void parse_program_counter(unsigned int unpseudo_count) // Now GotByte =
|
||||
is_not_defined(NULL, "*", 1);
|
||||
if (unpseudo_count)
|
||||
pseudopc_unpseudo(&pc, pseudopc_get_context(), unpseudo_count);
|
||||
PUSH_INT_ARG(pc.val.intval, pc.flags, pc.addr_refs); // FIXME - when undefined pc is allowed, this must be changed for numtype!
|
||||
// push to arg stack
|
||||
arg = &arg_stack[arg_sp++];
|
||||
arg->type = &type_number;
|
||||
arg->u.number = pc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -212,18 +212,13 @@ static int first_symbol_of_statement(void)
|
||||
static void set_label(scope_t scope, bits force_bit, bits powers)
|
||||
{
|
||||
struct symbol *symbol;
|
||||
struct number pc;
|
||||
struct object result;
|
||||
|
||||
if ((statement_flags & SF_FOUND_BLANK) && config.warn_on_indented_labels)
|
||||
Throw_first_pass_warning("Label name not in leftmost column.");
|
||||
symbol = symbol_find(scope);
|
||||
vcpu_read_pc(&pc); // FIXME - if undefined, check pass.complain_about_undefined and maybe throw "value not defined"!
|
||||
result.type = &type_number;
|
||||
result.u.number.ntype = NUMTYPE_INT; // FIXME - if undefined, use NUMTYPE_UNDEFINED!
|
||||
result.u.number.flags = 0;
|
||||
result.u.number.val.intval = pc.val.intval;
|
||||
result.u.number.addr_refs = pc.addr_refs;
|
||||
vcpu_read_pc(&result.u.number); // FIXME - if undefined, check pass.complain_about_undefined and maybe throw "value not defined"!
|
||||
symbol_set_object(symbol, &result, powers);
|
||||
if (force_bit)
|
||||
symbol_set_force_bit(symbol, force_bit);
|
||||
|
@ -133,7 +133,7 @@ static void report_redefinition(struct rwnode *macro_node)
|
||||
struct macro *original_macro = macro_node->body;
|
||||
|
||||
// show warning with location of current definition
|
||||
Throw_warning(exception_macro_twice);
|
||||
Throw_warning(exception_macro_twice); // FIXME - throw as info?
|
||||
// CAUTION, ugly kluge: fiddle with input_now and section_now
|
||||
// data to generate helpful error messages
|
||||
input_now->original_filename = original_macro->def_filename;
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#define RELEASE "0.97" // update before release FIXME
|
||||
#define CODENAME "Zem" // update before release
|
||||
#define CHANGE_DATE "16 Feb" // update before release FIXME
|
||||
#define CHANGE_DATE "17 Feb" // update before release FIXME
|
||||
#define CHANGE_YEAR "2024" // update before release
|
||||
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/"
|
||||
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME
|
||||
|
7
testing/auto/unpseudo.a
Normal file
7
testing/auto/unpseudo.a
Normal file
@ -0,0 +1,7 @@
|
||||
*=$1000
|
||||
nop
|
||||
!pseudopc $0300 {
|
||||
nop
|
||||
!if * != $0301 { !error "pseudo pc is not $301" }
|
||||
!if &* != $1002 { !error "un-pseudo'd pc is not $1002" }
|
||||
}
|
4
testing/errors/macrotwice.a
Normal file
4
testing/errors/macrotwice.a
Normal file
@ -0,0 +1,4 @@
|
||||
!macro dings {
|
||||
}
|
||||
!macro dings { ; -> "Macro already defined."
|
||||
}
|
1
testing/errors/obsolete1.a
Normal file
1
testing/errors/obsolete1.a
Normal file
@ -0,0 +1 @@
|
||||
!cbm ; -> ""!cbm" is obsolete; use "!ct pet" instead."
|
2
testing/errors/obsolete2.a
Normal file
2
testing/errors/obsolete2.a
Normal file
@ -0,0 +1,2 @@
|
||||
*=$1000
|
||||
!pseudopc $c000 ; -> ""!pseudopc/!realpc" is obsolete; use "!pseudopc {}" instead."
|
2
testing/errors/obsolete3.a
Normal file
2
testing/errors/obsolete3.a
Normal file
@ -0,0 +1,2 @@
|
||||
*=$1000
|
||||
!realpc ; -> ""!pseudopc/!realpc" is obsolete; use "!pseudopc {}" instead."
|
2
testing/errors/valuenotdefined5.a
Normal file
2
testing/errors/valuenotdefined5.a
Normal file
@ -0,0 +1,2 @@
|
||||
Zaphod
|
||||
*=Zaphod ; -> "Symbol not defined." -> "Value not defined."
|
3
testing/warnings/65ce02-sed.a
Normal file
3
testing/warnings/65ce02-sed.a
Normal file
@ -0,0 +1,3 @@
|
||||
!cpu 65ce02
|
||||
*=$1000
|
||||
sed ; -> "Found SED instruction for CPU with known decimal SBC bug."
|
2
testing/warnings/double-symbollist.a
Normal file
2
testing/warnings/double-symbollist.a
Normal file
@ -0,0 +1,2 @@
|
||||
!symbollist "dummy.o"
|
||||
!symbollist "dummy.o" ; -> "Symbol list file name already chosen."
|
2
testing/warnings/double-to.a
Normal file
2
testing/warnings/double-to.a
Normal file
@ -0,0 +1,2 @@
|
||||
!to "dummy.o", cbm
|
||||
!to "dummy.o", cbm ; -> "Output file name already chosen."
|
1
testing/warnings/eorxor.a
Normal file
1
testing/warnings/eorxor.a
Normal file
@ -0,0 +1 @@
|
||||
result = 3 eor 5 ; -> ""EOR" is deprecated; use "XOR" instead."
|
1
testing/warnings/fileformat.a
Normal file
1
testing/warnings/fileformat.a
Normal file
@ -0,0 +1 @@
|
||||
!to "dummy.o" ; -> "Used "!to" without file format indicator."
|
1
testing/warnings/float2int1.a
Normal file
1
testing/warnings/float2int1.a
Normal file
@ -0,0 +1 @@
|
||||
result = 3 and 2.7 ; -> "Converted to integer for binary logic operator."
|
1
testing/warnings/float2int2.a
Normal file
1
testing/warnings/float2int2.a
Normal file
@ -0,0 +1 @@
|
||||
result = 2.7 and 3 ; -> "Converted to integer for binary logic operator."
|
2
testing/warnings/jmpindirect.a
Normal file
2
testing/warnings/jmpindirect.a
Normal file
@ -0,0 +1,2 @@
|
||||
*=$1000
|
||||
jmp ($01ff) ; -> "Assembling buggy JMP($xxff) instruction."
|
2
testing/warnings/labelcolumn.a
Normal file
2
testing/warnings/labelcolumn.a
Normal file
@ -0,0 +1,2 @@
|
||||
*=$1000
|
||||
label ; -> "Label name not in leftmost column."
|
3
testing/warnings/nmos-ane.a
Normal file
3
testing/warnings/nmos-ane.a
Normal file
@ -0,0 +1,3 @@
|
||||
!cpu nmos6502
|
||||
*=$1000
|
||||
ane #$ff ; -> "Assembling unstable ANE #NONZERO instruction."
|
3
testing/warnings/nmos-lxa.a
Normal file
3
testing/warnings/nmos-lxa.a
Normal file
@ -0,0 +1,3 @@
|
||||
!cpu nmos6502
|
||||
*=$1000
|
||||
lxa #$ff ; -> "Assembling unstable LXA #NONZERO instruction."
|
4
testing/warnings/oldfor.a
Normal file
4
testing/warnings/oldfor.a
Normal file
@ -0,0 +1,4 @@
|
||||
*=$1000
|
||||
!for i, 5 { ; -> "Found old "!for" syntax."
|
||||
nop
|
||||
}
|
2
testing/warnings/parentheses.a
Normal file
2
testing/warnings/parentheses.a
Normal file
@ -0,0 +1,2 @@
|
||||
*=$1000
|
||||
label beq (label) ; -> "There are unneeded parentheses, you know indirect addressing is impossible here, right?"
|
2
testing/warnings/shiftspace.a
Normal file
2
testing/warnings/shiftspace.a
Normal file
@ -0,0 +1,2 @@
|
||||
*=$1000
|
||||
label ; -> "Symbol name starts with a shift-space character."
|
Loading…
x
Reference in New Issue
Block a user