mirror of
https://github.com/ksherlock/x65.git
synced 2024-12-29 10:30:32 +00:00
Fix for INCSYM directive when loading files with local labels
This commit is contained in:
parent
7d59943d35
commit
0605a1d6d2
@ -100,6 +100,7 @@ Primarily tested with personal archive of sources written for Kick assmebler, DA
|
||||
* irp (indefinite repeat)
|
||||
|
||||
**FIXED**
|
||||
* INCSYM failed with local labels
|
||||
* INCBIN and IMPORT BINARY always failed (force 0 bytes length)
|
||||
* Using more than 16 bytes of Pool labels was flawed
|
||||
* Fixed STRUCT directive (failed if contained line was empty)
|
||||
|
38
x65.cpp
38
x65.cpp
@ -4152,22 +4152,30 @@ StatusCode Asm::IncludeSymbols(strref line)
|
||||
strref symfile(buffer, strl_t(size));
|
||||
while (symfile) {
|
||||
symfile.skip_whitespace();
|
||||
if (symfile[0]=='{') // don't include local labels
|
||||
symfile.scoped_block_skip();
|
||||
if (strref symdef = symfile.line()) {
|
||||
strref symtype = symdef.split_token(' ');
|
||||
strref label = symdef.split_token_trim('=');
|
||||
bool constant = symtype.same_str(".const"); // first word is either .label or .const
|
||||
if (symlist) {
|
||||
strref symchk = symlist;
|
||||
while (strref symwant = symchk.split_token_trim(',')) {
|
||||
if (symwant.same_str_case(label)) {
|
||||
AssignLabel(label, symdef, constant);
|
||||
break;
|
||||
strref symstart = symfile;
|
||||
if (strref symline = symfile.line()) {
|
||||
int scope_start = symline.find('{');
|
||||
if (scope_start > 0) {
|
||||
strref symdef = symline.get_substr(0, scope_start);
|
||||
symdef.clip_trailing_whitespace();
|
||||
strref symtype = symdef.split_token(' ');
|
||||
strref label = symdef.split_token_trim('=');
|
||||
bool constant = symtype.same_str(".const"); // first word is either .label or .const
|
||||
if (symlist) {
|
||||
strref symchk = symlist;
|
||||
while (strref symwant = symchk.split_token_trim(',')) {
|
||||
if (symwant.same_str_case(label)) {
|
||||
AssignLabel(label, symdef, constant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
AssignLabel(label, symdef, constant);
|
||||
} else
|
||||
AssignLabel(label, symdef, constant);
|
||||
}
|
||||
if (scope_start >= 0) {
|
||||
symfile = symstart + scope_start;
|
||||
symfile.scoped_block_skip();
|
||||
}
|
||||
}
|
||||
}
|
||||
loadedData.push_back(buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user