diff --git a/src/pseudoopcodes.c b/src/pseudoopcodes.c index bca28f7..ed07435 100644 --- a/src/pseudoopcodes.c +++ b/src/pseudoopcodes.c @@ -95,16 +95,20 @@ void notreallypo_setpc(void) // GotByte is '*' // before actually setting pc, // support stupidly bad, old, ancient, deprecated, obsolete behaviour: if (pseudopc_isactive()) { - if (config.dialect < V0_93__SHORTER_SETPC_WARNING) { - Throw_warning("Offset assembly still active at end of segment. Switched it off."); - end_all_pseudopc(); - } else if (config.dialect < V0_94_8__DISABLED_OBSOLETE) { + if (config.dialect >= V0_94_8__DISABLED_OBSOLETE) { + // current behaviour: + // setting pc does not disable pseudopc + } else if (config.dialect >= V0_93__SHORTER_SETPC_WARNING) { Throw_warning("Offset assembly still active at end of segment."); - end_all_pseudopc(); // warning no longer said it - // would switch off, but still did. nevertheless, there + end_all_pseudopc(); // warning did not say it would + // disable pseudopc, but still did. nevertheless, there // is something different to older versions: when the // closing '}' or !realpc is encountered, _really_ weird // stuff happens! i see no reason to try to mimic that. + } else { + // prior to 0.93, setting pc disabled pseudopc with a warning: + Throw_warning("Offset assembly still active at end of segment. Switched it off."); + end_all_pseudopc(); } } @@ -676,18 +680,15 @@ static enum eos po_align(void) // not using a block is no longer allowed static void old_offset_assembly(void) { - // really old versions allowed it - if (config.dialect < V0_86__DEPRECATE_REALPC) - return; - - // then it was deprecated - if (config.dialect < V0_94_8__DISABLED_OBSOLETE) { + if (config.dialect >= V0_94_8__DISABLED_OBSOLETE) { + // now it's obsolete + Throw_error("\"!pseudopc/!realpc\" is obsolete; use \"!pseudopc {}\" instead."); // FIXME - amend msg, tell user how to use old behaviour! + } else if (config.dialect >= V0_86__DEPRECATE_REALPC) { + // earlier it was deprecated Throw_first_pass_warning("\"!pseudopc/!realpc\" is deprecated; use \"!pseudopc {}\" instead."); - return; + } else { + // really old versions allowed it } - - // now it's obsolete - Throw_error("\"!pseudopc/!realpc\" is obsolete; use \"!pseudopc {}\" instead."); // FIXME - amend msg, tell user how to use old behaviour! } // start offset assembly diff --git a/src/version.h b/src/version.h index 5fd7901..6caaf4f 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ #define RELEASE "0.97" // update before release FIXME #define CODENAME "Zem" // update before release -#define CHANGE_DATE "19 Feb" // update before release FIXME +#define CHANGE_DATE "20 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 diff --git a/testing/cliargs/Makefile b/testing/cliargs/Makefile index c149590..3d44682 100644 --- a/testing/cliargs/Makefile +++ b/testing/cliargs/Makefile @@ -1,14 +1,22 @@ #ACMEFLAGS = -v0 -.PHONY: outformats +.PHONY: dialects outformats .SILENT: -all: outformats +all: dialects outformats echo echo "Testing cliargs: PASSED" echo +dialects: dialect085.a dialect086.a dialect09406.a dialect09408.a dialect09412.a + acme --strict --dialect 0.85 dialect085.a + acme --strict --dialect 0.86 dialect086.a + acme --strict --dialect 0.94.6 dialect09406.a + acme --strict --dialect 0.94.8 dialect09408.a + acme --strict --dialect 0.94.12 dialect09412.a + $(RM) test.o + outformats: outformats.a outformats.sh outformat-*.exp echo "Testing output formats:" bash outformats.sh diff --git a/testing/cliargs/dialect085.a b/testing/cliargs/dialect085.a new file mode 100644 index 0000000..4d03820 --- /dev/null +++ b/testing/cliargs/dialect085.a @@ -0,0 +1,9 @@ + ; 0.86 warns about using "!to" without file format indicator: + !to "test.o" + ; "!pseudopc"/"!realpc" warn in 0.86, throw error in 0.94.8: + *=$1000 + !pseudopc $2345 + !wo * + !realpc + + !src "dialect086.a" diff --git a/testing/cliargs/dialect086.a b/testing/cliargs/dialect086.a new file mode 100644 index 0000000..db9be41 --- /dev/null +++ b/testing/cliargs/dialect086.a @@ -0,0 +1,6 @@ + ; "power of" is left-associative, becomes right-associative in 0.94.6: + !if 2^3^4 != (2^3)^4 { + !error "power-of operator is not left-associative." + } + + !src "dialect09406.a" diff --git a/testing/cliargs/dialect09406.a b/testing/cliargs/dialect09406.a new file mode 100644 index 0000000..1517f94 --- /dev/null +++ b/testing/cliargs/dialect09406.a @@ -0,0 +1,24 @@ + ; "!pseudopc"/"!realpc" throw error in 0.94.8: + *=$2000 +!nowarn !pseudopc $2345 + !wo * +!nowarn !realpc + ; "!cbm" throws error in 0.94.8: +!nowarn !cbm + ; "!subzone" throws error in 0.94.8: +!nowarn !subzone dummy + ; "*=" terminates "!pseudopc", works in 0.94.8: + !pseudopc $1010 { + !if * != $1010 { + !error "pc is not $1010" + } +!nowarn *=$2020 + !if * != $2020 { + !error "pc is not $2020" + } + } + !if * != $2020 { + !error "pc is not $2020" + } + + !src "dialect09408.a" diff --git a/testing/cliargs/dialect09408.a b/testing/cliargs/dialect09408.a new file mode 100644 index 0000000..0a6986e --- /dev/null +++ b/testing/cliargs/dialect09408.a @@ -0,0 +1,6 @@ + ; "!for" syntax changes in 0.94.12: + !for ii, 4 { + !info ii + } + + !src "dialect09412.a" diff --git a/testing/cliargs/dialect09412.a b/testing/cliargs/dialect09412.a new file mode 100644 index 0000000..45ed140 --- /dev/null +++ b/testing/cliargs/dialect09412.a @@ -0,0 +1,5 @@ + ; double-quotes indicate strings in 0.97: + a = "a" + 10 + ; backslash becomes escape char in 0.97: + b = "\" + c = '\' diff --git a/testing/errors/targetoutofrange.a b/testing/errors/targetoutofrange.a new file mode 100644 index 0000000..2b45c54 --- /dev/null +++ b/testing/errors/targetoutofrange.a @@ -0,0 +1,2 @@ + *=$1000 + beq $1083 ; -> "Target out of range (129; 2 too far)."