fixed bug where "!skip" areas at start/end were included in output file

git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@419 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
marcobaye 2024-09-03 10:01:43 +00:00
parent fc98be0ee1
commit b7037ea990
2 changed files with 5 additions and 20 deletions

View File

@ -203,7 +203,6 @@ void (*output_byte)(intval_t byte);
// send low byte to output buffer and remember to later increase program counter // send low byte to output buffer and remember to later increase program counter
static void real_output(intval_t byte) static void real_output(intval_t byte)
{ {
// CAUTION - there are two copies of these checks!
// TODO - add additional check for current segment's "limit" value // TODO - add additional check for current segment's "limit" value
// did we reach next segment? // did we reach next segment?
if (out->write_idx >= out->segm.limit) if (out->write_idx >= out->segm.limit)
@ -266,25 +265,11 @@ void output_skip(int size)
if (PC_NOT_SET) if (PC_NOT_SET)
complain_and_use_dummy_pc(); complain_and_use_dummy_pc();
// CAUTION - there are two copies of these checks! // removed all address checks because "skip" does not actually write!
// TODO - add additional check for current segment's "limit" value // if a source code starts/ends with "!skip 20", older versions included that
// did we reach next segment? // part in the output file, which is stupid and contradicts the fact that empty
// FIXME - this checks whether the final "write that did not really happen" // segments at the start/end are not included either!
// is already in another segment. but it does not check any of those before, and
// they could also have breached (small) segments. so either check all "writes"
// or none of them! - atm I prefer "none", because "!skip" does not write...
if (out->write_idx + size - 1 >= out->segm.limit)
breached_limit(out->write_idx + size - 1);
// FIXME - the checks below do not make sense; why do we treat addresses that
// were skipped as if they have been written to? if a source ends on "!skip 20",
// why should those bytes be included in the file?
// new minimum address?
if (out->write_idx < out->lowest_written)
out->lowest_written = out->write_idx;
// new maximum address?
if (out->write_idx + size - 1 > out->highest_written)
out->highest_written = out->write_idx + size - 1;
// advance ptrs // advance ptrs
out->write_idx += size; out->write_idx += size;
statement_size += size; // count bytes so PC will be adjusted correctly after this statement_size += size; // count bytes so PC will be adjusted correctly after this

View File

@ -9,7 +9,7 @@
#define RELEASE "0.97" // update before release FIXME #define RELEASE "0.97" // update before release FIXME
#define CODENAME "Zem" // update before release #define CODENAME "Zem" // update before release
#define CHANGE_DATE "21 Aug" // update before release FIXME #define CHANGE_DATE "22 Aug" // update before release FIXME
#define CHANGE_YEAR "2024" // update before release #define CHANGE_YEAR "2024" // update before release
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/" //#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/"
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME #define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME