1
0
mirror of https://github.com/ksherlock/x65.git synced 2025-08-07 19:25:05 +00:00

Fix for INCSYM directive when loading files with local labels

This commit is contained in:
Carl-Henrik Skårstedt
2016-02-14 12:36:01 -08:00
parent 7d59943d35
commit 0605a1d6d2
2 changed files with 24 additions and 15 deletions

View File

@@ -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)

14
x65.cpp
View File

@@ -4152,9 +4152,12 @@ 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 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
@@ -4169,6 +4172,11 @@ StatusCode Asm::IncludeSymbols(strref line)
} else
AssignLabel(label, symdef, constant);
}
if (scope_start >= 0) {
symfile = symstart + scope_start;
symfile.scoped_block_skip();
}
}
}
loadedData.push_back(buffer);
} else