diff --git a/src/asm/parser.y b/src/asm/parser.y index 41549b603c..8fdcae6671 100644 --- a/src/asm/parser.y +++ b/src/asm/parser.y @@ -956,29 +956,58 @@ compoundeq : T_POP_ADDEQ { $$ = RPN_ADD; } | T_POP_SHREQ { $$ = RPN_SHR; } ; -equ : T_LABEL T_POP_EQU const { sym_AddEqu($1, $3); } +equ : T_LABEL T_POP_EQU const { + warning(WARNING_OBSOLETE, "`%s EQU` is deprecated; use `DEF %s EQU`\n", $1, $1); + sym_AddEqu($1, $3); + } ; -assignment : T_LABEL T_POP_EQUAL const { sym_AddVar($1, $3); } - | T_LABEL compoundeq const { compoundAssignment($1, $2, $3); } +assignment : T_LABEL T_POP_EQUAL const { + warning(WARNING_OBSOLETE, "`%s =` is deprecated; use `DEF %s =`\n", $1, $1); + sym_AddVar($1, $3); + } + | T_LABEL compoundeq const { + static const char *compoundEqOperators[] = { + [RPN_ADD] = "+=", + [RPN_SUB] = "-=", + [RPN_MUL] = "*=", + [RPN_DIV] = "/=", + [RPN_MOD] = "%=", + [RPN_XOR] = "^=", + [RPN_OR] = "|=", + [RPN_AND] = "&=", + [RPN_SHL] = "<<=", + [RPN_SHR] = ">>=", + }; + + warning(WARNING_OBSOLETE, "`%s %s` is deprecated; use `DEF %s %s`\n", + $1, compoundEqOperators[$2], $1, compoundEqOperators[$2]); + compoundAssignment($1, $2, $3); + } ; -equs : T_LABEL T_POP_EQUS string { sym_AddString($1, $3); } +equs : T_LABEL T_POP_EQUS string { + warning(WARNING_OBSOLETE, "`%s EQUS` is deprecated; use `DEF %s EQUS`\n", $1, $1); + sym_AddString($1, $3); + } ; rb : T_LABEL T_POP_RB rs_uconst { + warning(WARNING_OBSOLETE, "`%s RB` is deprecated; use `DEF %s RB`\n", $1, $1); sym_AddEqu($1, sym_GetConstantValue("_RS")); sym_AddVar("_RS", sym_GetConstantValue("_RS") + $3); } ; rw : T_LABEL T_POP_RW rs_uconst { + warning(WARNING_OBSOLETE, "`%s RW` is deprecated; use `DEF %s RW`\n", $1, $1); sym_AddEqu($1, sym_GetConstantValue("_RS")); sym_AddVar("_RS", sym_GetConstantValue("_RS") + 2 * $3); } ; rl : T_LABEL T_Z80_RL rs_uconst { + warning(WARNING_OBSOLETE, "`%s RL` is deprecated; use `DEF %s RL`\n", $1, $1); sym_AddEqu($1, sym_GetConstantValue("_RS")); sym_AddVar("_RS", sym_GetConstantValue("_RS") + 4 * $3); } diff --git a/test/asm/bracketed-macro-args.asm b/test/asm/bracketed-macro-args.asm index b0ddce342c..bbbd9d7e43 100644 --- a/test/asm/bracketed-macro-args.asm +++ b/test/asm/bracketed-macro-args.asm @@ -10,9 +10,9 @@ ENDM MACRO mac println \<2__> + \<1_2> + \<\1> -x = 2 + def x = 2 println \<{d:x}> + \<1_{d:x}> + \<\<\<13>>> -y equs "NARG" + def y equs "NARG" println \ + \<1_{d:x}_> + \<\<\<_{y}>>> ENDM diff --git a/test/asm/bracketed-symbols.asm b/test/asm/bracketed-symbols.asm index f6e1dc21a6..b4ccf6fd65 100644 --- a/test/asm/bracketed-symbols.asm +++ b/test/asm/bracketed-symbols.asm @@ -1,18 +1,18 @@ -X = 42 +DEF X = 42 PRINTLN "{X}" PRINTLN "{x:X}" PRINTLN "{X:X}" PRINTLN "{d:X}" PRINTLN "{b:X}" -Y equ 1337 +DEF Y EQU 1337 PRINTLN "{b:Y}" rsreset -R rb 0 +DEF R RB 0 PRINTLN "{d:R}" -S equs "You can't format me!" +DEF S EQUS "You can't format me!" PRINTLN "{X:S}" SECTION "Test", ROM0 diff --git a/test/asm/builtin-overwrite.asm b/test/asm/builtin-overwrite.asm index cea61ac8c2..9f09633948 100644 --- a/test/asm/builtin-overwrite.asm +++ b/test/asm/builtin-overwrite.asm @@ -2,17 +2,6 @@ macro tickle ; There once was a bug where overwriting worked only on the second try, so ; try everything twice for good measure -; Skip this syntax for EQUS, as it is invalid -IF \2 -\1 = 0 -\1 = 0 -PRINTLN \1 - -\1 EQU 0 -\1 EQU 0 -PRINTLN \1 -ENDC - PURGE \1 PURGE \1 PRINTLN \1 diff --git a/test/asm/builtin-overwrite.err b/test/asm/builtin-overwrite.err index 2b5dc1909f..eb073cdba0 100644 --- a/test/asm/builtin-overwrite.err +++ b/test/asm/builtin-overwrite.err @@ -1,57 +1,49 @@ -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(7): - '__UTC_YEAR__' already defined as constant at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(8): - '__UTC_YEAR__' already defined as constant at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(11): - '__UTC_YEAR__' already defined at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(12): - '__UTC_YEAR__' already defined at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(16): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(5): Built-in symbol '__UTC_YEAR__' cannot be purged -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(17): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(6): Built-in symbol '__UTC_YEAR__' cannot be purged -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(20): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(9): '__UTC_YEAR__' already defined at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(21): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(10): '__UTC_YEAR__' already defined at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(24): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(13): '__UTC_YEAR__' already defined as constant at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(25): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(14): '__UTC_YEAR__' already defined as constant at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(28): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(17): '__UTC_YEAR__' already defined at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(29): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(18): '__UTC_YEAR__' already defined at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(32): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(21): '__UTC_YEAR__' already defined as constant at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(33): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(22): '__UTC_YEAR__' already defined as constant at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(36): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(25): '__UTC_YEAR__' already defined as non-EQUS at -error: builtin-overwrite.asm(43) -> builtin-overwrite.asm::tickle(37): +error: builtin-overwrite.asm(32) -> builtin-overwrite.asm::tickle(26): '__UTC_YEAR__' already defined as non-EQUS at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(16): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(5): Built-in symbol '__ISO_8601_UTC__' cannot be purged -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(17): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(6): Built-in symbol '__ISO_8601_UTC__' cannot be purged -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(20): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(9): '__ISO_8601_UTC__' already defined at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(21): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(10): '__ISO_8601_UTC__' already defined at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(24): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(13): '__ISO_8601_UTC__' already defined as constant at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(25): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(14): '__ISO_8601_UTC__' already defined as constant at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(28): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(17): '__ISO_8601_UTC__' already defined at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(29): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(18): '__ISO_8601_UTC__' already defined at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(32): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(21): '__ISO_8601_UTC__' already defined as constant at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(33): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(22): '__ISO_8601_UTC__' already defined as constant at -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(36): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(25): Built-in symbol '__ISO_8601_UTC__' cannot be redefined -error: builtin-overwrite.asm(44) -> builtin-overwrite.asm::tickle(37): +error: builtin-overwrite.asm(33) -> builtin-overwrite.asm::tickle(26): Built-in symbol '__ISO_8601_UTC__' cannot be redefined -error: Assembly aborted (28 errors)! +error: Assembly aborted (24 errors)! diff --git a/test/asm/builtin-overwrite.out b/test/asm/builtin-overwrite.out index d7fcfda7bd..f0170b0442 100644 --- a/test/asm/builtin-overwrite.out +++ b/test/asm/builtin-overwrite.out @@ -4,8 +4,6 @@ $7C5 $7C5 $7C5 $7C5 -$7C5 -$7C5 1989-04-21T12:34:56Z 1989-04-21T12:34:56Z 1989-04-21T12:34:56Z diff --git a/test/asm/charlen-charsub.asm b/test/asm/charlen-charsub.asm index 0fb7f68256..4736d76d06 100644 --- a/test/asm/charlen-charsub.asm +++ b/test/asm/charlen-charsub.asm @@ -7,7 +7,7 @@ SECTION "test", ROM0 -S EQUS "XBoldABC" +DEF S EQUS "XBoldABC" assert CHARLEN("{S}") == 6 println CHARSUB("{S}", 2) diff --git a/test/asm/compound-assignment.asm b/test/asm/compound-assignment.asm index b113795777..279abc17ec 100644 --- a/test/asm/compound-assignment.asm +++ b/test/asm/compound-assignment.asm @@ -30,8 +30,8 @@ endm try "def ", q try "redef ", r -_RS += 100 +def _RS += 100 println _RS -UnDeFiNeD ^= 300 +def UnDeFiNeD ^= 300 println UnDeFiNeD diff --git a/test/asm/compound-assignment.err b/test/asm/compound-assignment.err index 867deae20a..77b0e3009e 100644 --- a/test/asm/compound-assignment.err +++ b/test/asm/compound-assignment.err @@ -1,3 +1,25 @@ +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(4): [-Wobsolete] + `p =` is deprecated; use `DEF p =` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(6): [-Wobsolete] + `p +=` is deprecated; use `DEF p +=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(8): [-Wobsolete] + `p -=` is deprecated; use `DEF p -=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(10): [-Wobsolete] + `p *=` is deprecated; use `DEF p *=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(12): [-Wobsolete] + `p /=` is deprecated; use `DEF p /=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(14): [-Wobsolete] + `p %=` is deprecated; use `DEF p %=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(16): [-Wobsolete] + `p |=` is deprecated; use `DEF p |=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(18): [-Wobsolete] + `p ^=` is deprecated; use `DEF p ^=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(20): [-Wobsolete] + `p &=` is deprecated; use `DEF p &=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(22): [-Wobsolete] + `p <<=` is deprecated; use `DEF p <<=` +warning: compound-assignment.asm(29) -> compound-assignment.asm::try(24): [-Wobsolete] + `p >>=` is deprecated; use `DEF p >>=` error: compound-assignment.asm(36): Expected constant expression: 'UnDeFiNeD' is not constant at assembly time error: Assembly aborted (1 error)! diff --git a/test/asm/def.asm b/test/asm/def.asm index 580fbda8d1..21b8d8c993 100644 --- a/test/asm/def.asm +++ b/test/asm/def.asm @@ -28,3 +28,22 @@ redef string equs "there" redef constant equ 6*9 println constant + +old_constant EQU 42 +old_string EQUS "hello" + +old_variable = 2 + 2 +old_variable += 3 +old_variable *= 4 +old_variable -= 1 +old_variable /= 5 +old_variable %= 7 +old_variable &= $ffff +old_variable |= %1010 +old_variable ^= &123 +old_variable <<= 2 +old_variable >>= 1 + +old_byte rb +old_word rw +old_long rl diff --git a/test/asm/def.err b/test/asm/def.err index e2e1e97894..afdfa613fb 100644 --- a/test/asm/def.err +++ b/test/asm/def.err @@ -1,3 +1,35 @@ error: def.asm(23): 'constant' already defined at def.asm(10) +warning: def.asm(32): [-Wobsolete] + `old_constant EQU` is deprecated; use `DEF old_constant EQU` +warning: def.asm(33): [-Wobsolete] + `old_string EQUS` is deprecated; use `DEF old_string EQUS` +warning: def.asm(35): [-Wobsolete] + `old_variable =` is deprecated; use `DEF old_variable =` +warning: def.asm(36): [-Wobsolete] + `old_variable +=` is deprecated; use `DEF old_variable +=` +warning: def.asm(37): [-Wobsolete] + `old_variable *=` is deprecated; use `DEF old_variable *=` +warning: def.asm(38): [-Wobsolete] + `old_variable -=` is deprecated; use `DEF old_variable -=` +warning: def.asm(39): [-Wobsolete] + `old_variable /=` is deprecated; use `DEF old_variable /=` +warning: def.asm(40): [-Wobsolete] + `old_variable %=` is deprecated; use `DEF old_variable %=` +warning: def.asm(41): [-Wobsolete] + `old_variable &=` is deprecated; use `DEF old_variable &=` +warning: def.asm(42): [-Wobsolete] + `old_variable |=` is deprecated; use `DEF old_variable |=` +warning: def.asm(43): [-Wobsolete] + `old_variable ^=` is deprecated; use `DEF old_variable ^=` +warning: def.asm(44): [-Wobsolete] + `old_variable <<=` is deprecated; use `DEF old_variable <<=` +warning: def.asm(45): [-Wobsolete] + `old_variable >>=` is deprecated; use `DEF old_variable >>=` +warning: def.asm(47): [-Wobsolete] + `old_byte RB` is deprecated; use `DEF old_byte RB` +warning: def.asm(48): [-Wobsolete] + `old_word RW` is deprecated; use `DEF old_word RW` +warning: def.asm(49): [-Wobsolete] + `old_long RL` is deprecated; use `DEF old_long RL` error: Assembly aborted (1 error)! diff --git a/test/asm/endc-eof-newline.asm b/test/asm/endc-eof-newline.asm index 588f5c8cc7..b4f7de1476 100644 --- a/test/asm/endc-eof-newline.asm +++ b/test/asm/endc-eof-newline.asm @@ -1,8 +1,8 @@ IF 1 -X = 0 +DEF X = 0 INCLUDE "endc-eof-newline.inc" INCLUDE "endc-eof-newline-else.inc" -X = 1 +DEF X = 1 INCLUDE "endc-eof-newline.inc" INCLUDE "endc-eof-newline-else.inc" -ENDC \ No newline at end of file +ENDC diff --git a/test/asm/equ-charmap.asm b/test/asm/equ-charmap.asm index 917a0573cf..ccb37fd98c 100644 --- a/test/asm/equ-charmap.asm +++ b/test/asm/equ-charmap.asm @@ -1,4 +1,4 @@ charmap "A", 1 SECTION "sec", ROM0[0] -_A_ EQU "A" +DEF _A_ EQU "A" db _A_ diff --git a/test/asm/equs-macrodef.asm b/test/asm/equs-macrodef.asm index 449f319a0e..849addc754 100644 --- a/test/asm/equs-macrodef.asm +++ b/test/asm/equs-macrodef.asm @@ -1,3 +1,3 @@ -DEFINE equs "MACRO mac\nPRINTLN \"Hello :D\"\nENDM" +def DEFINE equs "MACRO mac\nPRINTLN \"Hello :D\"\nENDM" DEFINE mac diff --git a/test/asm/equs-nest.asm b/test/asm/equs-nest.asm index 15f83ab597..8af6da316b 100644 --- a/test/asm/equs-nest.asm +++ b/test/asm/equs-nest.asm @@ -1,4 +1,5 @@ -X1 equs "Y1 equs \"\\\"Success!\\\\n\\\"\"" -Y1 equs "Z1" +; the nested EQUS can't use DEF because Y1 would not be expanded +def X1 equs "Y1 equs \"\\\"Success!\\\\n\\\"\"" +def Y1 equs "Z1" X1 PRINT Z1 diff --git a/test/asm/equs-nest.err b/test/asm/equs-nest.err index e69de29bb2..98200fcd1c 100644 --- a/test/asm/equs-nest.err +++ b/test/asm/equs-nest.err @@ -0,0 +1,3 @@ +warning: equs-nest.asm(4): [-Wobsolete] + `Z1 EQUS` is deprecated; use `DEF Z1 EQUS` +while expanding symbol "X1" diff --git a/test/asm/equs-newline.asm b/test/asm/equs-newline.asm index 571577ec54..300a770698 100644 --- a/test/asm/equs-newline.asm +++ b/test/asm/equs-newline.asm @@ -1,4 +1,4 @@ -ACT equs "WARN \"First\"\nWARN \"Second\"" +def ACT equs "WARN \"First\"\nWARN \"Second\"" ACT WARN "Third" diff --git a/test/asm/equs-purge.asm b/test/asm/equs-purge.asm index 2cd7659c03..83a6b7ed74 100644 --- a/test/asm/equs-purge.asm +++ b/test/asm/equs-purge.asm @@ -1,2 +1,2 @@ -BYE equs "PURGE BYE\nWARN \"Crash?\"\n \n" +def BYE equs "PURGE BYE\nWARN \"Crash?\"\n \n" BYE diff --git a/test/asm/equs-recursion.asm b/test/asm/equs-recursion.asm index 9ca7c997cc..1d3e6ae152 100644 --- a/test/asm/equs-recursion.asm +++ b/test/asm/equs-recursion.asm @@ -1,2 +1,2 @@ -recurse EQUS "recurse" +DEF recurse EQUS "recurse" recurse diff --git a/test/asm/expand-empty-string.asm b/test/asm/expand-empty-string.asm index f79c01d23c..b1e7e5b50a 100644 --- a/test/asm/expand-empty-string.asm +++ b/test/asm/expand-empty-string.asm @@ -1,6 +1,6 @@ MACRO test -v equs "X" -X equs "" ; should not be expanded +def v equs "X" +def X equs "" ; should not be expanded \1 ENDM test v 0 diff --git a/test/asm/ff00+c-label.asm b/test/asm/ff00+c-label.asm index 61370a33aa..0bf48baaf3 100644 --- a/test/asm/ff00+c-label.asm +++ b/test/asm/ff00+c-label.asm @@ -1,4 +1,4 @@ -CONSTANT equ 42 +def CONSTANT equ 42 PRINTLN $ff00 + CONSTANT SECTION "Overreading much?", ROM0[0] diff --git a/test/asm/fixed-point-precision.asm b/test/asm/fixed-point-precision.asm index 757738e915..f7b80923b4 100644 --- a/test/asm/fixed-point-precision.asm +++ b/test/asm/fixed-point-precision.asm @@ -1,22 +1,22 @@ -f1 = 3.1 -f2 = 5.2 -pm = MUL(f1, f2) -pr = 16.12 +def f1 = 3.1 +def f2 = 5.2 +def pm = MUL(f1, f2) +def pr = 16.12 println "`3.1`: {9.6f:f1} -> ${08x:f1}" println "`5.2`: {9.6f:f2} -> ${08x:f2}" println "`MUL`: {9.6f:pm} -> ${08x:pm}" println "`16.12`: {9.6f:pr} -> ${08x:pr}" -fl = 6.283185 +def fl = 6.283185 println "`6.283185`: {.6f:fl} -> ${08x:fl}" -fr = MUL(20.0, 0.32) +def fr = MUL(20.0, 0.32) println "32% of 20 = {f:fr} (~{.2f:fr}) (~~{.0f:fr})" -q8 = 1.25q8 -q16 = 1.25Q16 -q24 = 1.25q.24 +def q8 = 1.25q8 +def q16 = 1.25Q16 +def q24 = 1.25q.24 println "Q8 ${x:q8} Q16 ${x:q16} Q24 ${x:q24}" -qerr = 1.25q32 +def qerr = 1.25q32 println qerr diff --git a/test/asm/for.asm b/test/asm/for.asm index 7d04d01434..72102671b5 100644 --- a/test/asm/for.asm +++ b/test/asm/for.asm @@ -26,7 +26,7 @@ endr for v, 10, -1, -1 print "{d:v} " -v = 42 + def v = 42 endr println "-> {d:v}" @@ -36,7 +36,7 @@ purge q endr println "-> {d:q}" -s EQUS "x" +DEF s EQUS "x" for {s}, 3, 30, 3 print "{d:x} " endr @@ -46,7 +46,7 @@ for v, 10 println "{d:v}" if v == 3 purge v -v equ 42 ; causes a fatal error +def v equ 42 ; causes a fatal error endc endr println "-> {d:v}" diff --git a/test/asm/format-truncation.asm b/test/asm/format-truncation.asm index e54ddd9e8b..4ab824431e 100644 --- a/test/asm/format-truncation.asm +++ b/test/asm/format-truncation.asm @@ -1,6 +1,6 @@ -num equ 42 -fix equ 123.0 -str equs "hello" +def num equ 42 +def fix equ 123.0 +def str equs "hello" println "{#0260x:num}" println "{#-260x:num}" diff --git a/test/asm/interpolation-overflow.asm b/test/asm/interpolation-overflow.asm index aa7813803e..221c1fc53a 100644 --- a/test/asm/interpolation-overflow.asm +++ b/test/asm/interpolation-overflow.asm @@ -1,4 +1,4 @@ ; It seems that \1 was the easiest way to notice the memory corruption that ; resulted from this overflow -x = 0 +def x = 0 {.99999999f:x}\1 diff --git a/test/asm/interpolation-recursion.asm b/test/asm/interpolation-recursion.asm index a1e2ba5c46..90c973a1ce 100644 --- a/test/asm/interpolation-recursion.asm +++ b/test/asm/interpolation-recursion.asm @@ -1,2 +1,2 @@ -recurse EQUS "\{recurse\}" +DEF recurse EQUS "\{recurse\}" {recurse} diff --git a/test/asm/interpolation.asm b/test/asm/interpolation.asm index a5e6b03494..028ee65667 100644 --- a/test/asm/interpolation.asm +++ b/test/asm/interpolation.asm @@ -1,13 +1,13 @@ SECTION "Test", ROM0 -NAME equs "ITEM" -FMT equs "d" -ZERO_NUM equ 0 -ZERO_STR equs "0" +def NAME equs "ITEM" +def FMT equs "d" +def ZERO_NUM equ 0 +def ZERO_STR equs "0" ; Defines INDEX as 100 -INDEX = 1{ZERO_STR}{{FMT}:ZERO_NUM} +def INDEX = 1{ZERO_STR}{{FMT}:ZERO_NUM} ; Defines ITEM_100 as "\"hundredth\"" -{NAME}_{d:INDEX} equs "\"hundredth\"" +def {NAME}_{d:INDEX} equs "\"hundredth\"" ; Prints "ITEM_100 is hundredth" PRINTLN STRCAT("{NAME}_{d:INDEX}", " is ", {NAME}_{d:INDEX}) ; Purges ITEM_100 diff --git a/test/asm/invalid-utf-8-strings.asm b/test/asm/invalid-utf-8-strings.asm index 8f6afa525f..b43bda8efd 100644 --- a/test/asm/invalid-utf-8-strings.asm +++ b/test/asm/invalid-utf-8-strings.asm @@ -11,13 +11,13 @@ ; 10: invalid bytes 0xE6 0xF0 ; 11: invalid byte 0xA2 ; 12: U+0021 ! -invalid EQUS "aäbæ¼¢,a£¤bæð¢!" +DEF invalid EQUS "aäbæ¼¢,a£¤bæð¢!" -n = STRLEN("{invalid}") -copy EQUS STRSUB("{invalid}", 1) +DEF n = STRLEN("{invalid}") +DEF copy EQUS STRSUB("{invalid}", 1) println "\"{invalid}\" == \"{copy}\" ({d:n})" -mid1 EQUS STRSUB("{invalid}", 5, 2) -mid2 EQUS STRSUB("{invalid}", 9, 1) +DEF mid1 EQUS STRSUB("{invalid}", 5, 2) +DEF mid2 EQUS STRSUB("{invalid}", 9, 1) println "\"{mid2}{mid1}\"" diff --git a/test/asm/isconst.asm b/test/asm/isconst.asm index bc8c041c34..4c59c9dac7 100644 --- a/test/asm/isconst.asm +++ b/test/asm/isconst.asm @@ -1,10 +1,10 @@ -TEST_NUM = 0 +DEF TEST_NUM = 0 MACRO test_expr -TEST_NUM = TEST_NUM + 1 + DEF TEST_NUM = TEST_NUM + 1 -IS_CONST = ISCONST(\1) + DEF IS_CONST = ISCONST(\1) PRINTLN "Test #{d:TEST_NUM}: ISCONST reports {IS_CONST}" IF (\1) || 1 ; Only test if the expression can be evaluated WARN "Test #{d:TEST_NUM}: Compile-time constant" diff --git a/test/asm/jr-section.asm b/test/asm/jr-section.asm index 78ce9850e5..bbc9816002 100644 --- a/test/asm/jr-section.asm +++ b/test/asm/jr-section.asm @@ -2,5 +2,5 @@ SECTION "Test", ROM0 Label: jr Label -DIFF equ Label - @ +def DIFF equ Label - @ PRINTLN "{DIFF}" diff --git a/test/asm/label-macro-arg.asm b/test/asm/label-macro-arg.asm index 7ab45529de..42db8a68d7 100644 --- a/test/asm/label-macro-arg.asm +++ b/test/asm/label-macro-arg.asm @@ -1,12 +1,12 @@ MACRO m1 -x\1 +def x\1 ENDM -S EQUS "y" -S2 EQUS "yy" +DEF S EQUS "y" +DEF S2 EQUS "yy" MACRO m2 -S\1 +S\1 ; can't use DEF, so this will EQUS expand ENDM m1 = 5 @@ -21,12 +21,12 @@ ENDM MACRO test_char -VAR_DEF equs "sizeof_\1something = 0" +DEF VAR_DEF equs "DEF sizeof_\1something = 0" VAR_DEF -sizeof_\1something = 1 +DEF sizeof_\1something = 1 PURGE VAR_DEF -VAR_PRINT equs "println \"sizeof_\1something equals {sizeof_\1something}\"" +DEF VAR_PRINT equs "println \"sizeof_\1something equals {sizeof_\1something}\"" VAR_PRINT PURGE VAR_PRINT ENDM diff --git a/test/asm/label-macro-arg.err b/test/asm/label-macro-arg.err index 0b3fd3bb52..2ef5822a93 100644 --- a/test/asm/label-macro-arg.err +++ b/test/asm/label-macro-arg.err @@ -1,21 +1,21 @@ +warning: label-macro-arg.asm(13) -> label-macro-arg.asm::m2(9): [-Wobsolete] + `y =` is deprecated; use `DEF y =` +warning: label-macro-arg.asm(15) -> label-macro-arg.asm::m2(9): [-Wobsolete] + `yy =` is deprecated; use `DEF yy =` error: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(25): - syntax error, unexpected = + syntax error, unexpected local identifier, expecting identifier while expanding symbol "VAR_DEF" error: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(26): - syntax error, unexpected = + syntax error, unexpected local identifier, expecting identifier error: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(29): Interpolated symbol "sizeof_.something" does not exist error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(25): - Label "sizeof_" created outside of a SECTION + syntax error, unexpected label, expecting identifier while expanding symbol "VAR_DEF" -error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(25): - Macro "something" not defined -error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(26): - 'sizeof_' already defined at label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(25) error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(26): - Macro "something" not defined + syntax error, unexpected label, expecting identifier error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29): Invalid format spec 'sizeof_' error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29): Interpolated symbol "something" does not exist -error: Assembly aborted (9 errors)! +error: Assembly aborted (7 errors)! diff --git a/test/asm/label-macro-arg.simple.err b/test/asm/label-macro-arg.simple.err index 7c35be8e18..cd9ef65e49 100644 --- a/test/asm/label-macro-arg.simple.err +++ b/test/asm/label-macro-arg.simple.err @@ -1,3 +1,7 @@ +warning: label-macro-arg.asm(13) -> label-macro-arg.asm::m2(9): [-Wobsolete] + `y =` is deprecated; use `DEF y =` +warning: label-macro-arg.asm(15) -> label-macro-arg.asm::m2(9): [-Wobsolete] + `yy =` is deprecated; use `DEF yy =` error: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(25): Local label 'sizeof_.something' in main scope while expanding symbol "VAR_DEF" diff --git a/test/asm/long-rpn-expression.asm b/test/asm/long-rpn-expression.asm index f6d5ab77ef..a3a6a62093 100644 --- a/test/asm/long-rpn-expression.asm +++ b/test/asm/long-rpn-expression.asm @@ -1,18 +1,18 @@ SECTION "sec", ROM0 -X0 EQUS "0" +DEF X0 EQUS "0" MACRO m -\1 EQUS STRCAT("{X\2}", "+1") +DEF \1 EQUS STRCAT("{X\2}", "+1") ENDM FOR n, $7E -n1 = n + 1 +DEF n1 = n + 1 m X{X:n1}, {X:n} ENDR ; string of 127 zeros separated by plus signs -X EQUS "{X7E}" +DEF X EQUS "{X7E}" db x+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+\ X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+\ diff --git a/test/asm/macro-#.asm b/test/asm/macro-#.asm index 9d4c6277ef..69b5f1964d 100644 --- a/test/asm/macro-#.asm +++ b/test/asm/macro-#.asm @@ -17,8 +17,8 @@ MACRO person ENDM MACRO object -x = \1 -y = \2 + DEF x = \1 + DEF y = \2 shift 2 person y, x, \# ENDM @@ -30,7 +30,7 @@ MACRO echo println "\#" ENDM -R EQUS "S" +DEF R EQUS "S" echo P echo Q,R, {R}, T diff --git a/test/asm/macro-arg-in-string.asm b/test/asm/macro-arg-in-string.asm index 552be93ce8..e970c35a75 100644 --- a/test/asm/macro-arg-in-string.asm +++ b/test/asm/macro-arg-in-string.asm @@ -16,12 +16,12 @@ MACRO iprint PRINTLN "{\1}" ENDM -s EQUS "hello" +DEF s EQUS "hello" iprint s MACRO symprint PRINTLN {\1} ENDM -hello EQUS "\"goodbye\"" +DEF hello EQUS "\"goodbye\"" symprint s diff --git a/test/asm/macro-argument-limit.asm b/test/asm/macro-argument-limit.asm index 498d4ebd9d..48cd471fe0 100644 --- a/test/asm/macro-argument-limit.asm +++ b/test/asm/macro-argument-limit.asm @@ -1,8 +1,8 @@ MACRO addargs -sum = 0 + def sum = 0 rept _NARG -sum = sum + \1 - shift + def sum = sum + \1 + shift endr dw sum & $FFFF dw (sum >> 16) & $FFFF diff --git a/test/asm/math.asm b/test/asm/math.asm index 8bb1cde59f..d56a2f4638 100644 --- a/test/asm/math.asm +++ b/test/asm/math.asm @@ -1,12 +1,12 @@ -X equ 0 +def X equ 0 MACRO test ; Test RGBASM -v equs "X +" + def v equs "X +" static_assert \# purge v ; Test RGBLINK -v equs "Y +" + def v equs "Y +" assert \# purge v ENDM diff --git a/test/asm/minimum-int.asm b/test/asm/minimum-int.asm index 5c3cfc66fd..e85750c102 100644 --- a/test/asm/minimum-int.asm +++ b/test/asm/minimum-int.asm @@ -1,4 +1,4 @@ -m = $8000_0000 +def m = $8000_0000 assert m == 1 << 31 assert m == -(1 << 31) assert m == (-2)**31 diff --git a/test/asm/multi-line-strings.asm b/test/asm/multi-line-strings.asm index 02ce0f6741..b3ef78a7f0 100644 --- a/test/asm/multi-line-strings.asm +++ b/test/asm/multi-line-strings.asm @@ -1,4 +1,4 @@ -S EQUS "Hello" +DEF S EQUS "Hello" PRINT "\"\"\"\n" @@ -24,11 +24,11 @@ ENDM printarg """multi-line string argument""" -EMPTY1 EQUS "" -EMPTY2 EQUS "\ ; comment +DEF EMPTY1 EQUS "" +DEF EMPTY2 EQUS "\ ; comment " -EMPTY3 EQUS """""" -EMPTY4 EQUS """\ ; comment +DEF EMPTY3 EQUS """""" +DEF EMPTY4 EQUS """\ ; comment """ PRINTLN STRCAT("(", "{EMPTY1}", "{EMPTY2}", "{EMPTY3}", "{EMPTY4}", ")") diff --git a/test/asm/multiple-charmaps.asm b/test/asm/multiple-charmaps.asm index f9e86ebaed..c6ff4edfa5 100644 --- a/test/asm/multiple-charmaps.asm +++ b/test/asm/multiple-charmaps.asm @@ -26,8 +26,8 @@ MACRO pop_ ENDM MACRO print_mapped -x = \1 -println "{x}" + def x = \1 + println "{x}" ENDM println "main charmap" diff --git a/test/asm/nested-brackets.asm b/test/asm/nested-brackets.asm index 057a9f09cf..0d3b9e39f5 100644 --- a/test/asm/nested-brackets.asm +++ b/test/asm/nested-brackets.asm @@ -1,5 +1,5 @@ -STRING equs "OK" -WRAPPER equs "TRIN" +def STRING equs "OK" +def WRAPPER equs "TRIN" PRINTLN "{S{WRAPPER}G}" PRINTLN "{S{WRAPPER}G" diff --git a/test/asm/nested-break.asm b/test/asm/nested-break.asm index fbf3ab3271..e685005cb8 100644 --- a/test/asm/nested-break.asm +++ b/test/asm/nested-break.asm @@ -1,4 +1,4 @@ -n=1 +def n=1 rept 10 print "A" for x, 10 @@ -12,6 +12,6 @@ rept 10 break endc println "Z" -n=n+1 +def n=n+1 endr println "\nn={d:n} x={d:x}" diff --git a/test/asm/nested-macrodef.asm b/test/asm/nested-macrodef.asm index b2f7eb86fe..eaf1d16ac7 100644 --- a/test/asm/nested-macrodef.asm +++ b/test/asm/nested-macrodef.asm @@ -1,5 +1,5 @@ MACRO outer_ok -definition equs "MACRO inner_ok\nPRINTLN \"Hello!\"\nENDM" +def definition equs "MACRO inner_ok\nPRINTLN \"Hello!\"\nENDM" definition PURGE definition ENDM @@ -9,7 +9,7 @@ ENDM MACRO outer_arg -definition equs "MACRO inner_arg\nPRINTLN \"outer: \1\\ninner: \\1\"\nENDM" +def definition equs "MACRO inner_arg\nPRINTLN \"outer: \1\\ninner: \\1\"\nENDM" definition PURGE definition ENDM diff --git a/test/asm/overflow.asm b/test/asm/overflow.asm index be49062f09..209671b52c 100644 --- a/test/asm/overflow.asm +++ b/test/asm/overflow.asm @@ -4,38 +4,38 @@ MACRO print_x println x ENDM -x = 2147483647 -x = x + 1 +def x = 2147483647 +def x = x + 1 dl 2147483647+1 print_x -x = -2147483648 -x = x - 1 +def x = -2147483648 +def x = x - 1 dl -2147483648-1 print_x -x = -2147483648 -x = x * -1 +def x = -2147483648 +def x = x * -1 dl -2147483648 * -1 print_x -x = -2147483648 -x = x / -1 +def x = -2147483648 +def x = x / -1 dl -2147483648 / -1 print_x -x = -2147483648 -x = x % -1 +def x = -2147483648 +def x = x % -1 dl -2147483648 % -1 print_x -x = -1 -x = x << 1 +def x = -1 +def x = x << 1 dl -1 << 1 print_x -x = 4294967295 -x = 4294967296 +def x = 4294967295 +def x = 4294967296 -x = `33333333 -x = `333333333 +def x = `33333333 +def x = `333333333 diff --git a/test/asm/pc-bank.asm b/test/asm/pc-bank.asm index 4f0c78eb00..4ddd977b7c 100644 --- a/test/asm/pc-bank.asm +++ b/test/asm/pc-bank.asm @@ -1,11 +1,11 @@ SECTION "Fixed bank", ROMX,BANK[42] ldh a, [BANK(@) * 256] ; This should be complained about at assembly time -X = BANK(@) + DEF X = BANK(@) SECTION "Something else", ROMX -Y = BANK("Fixed bank") + DEF Y = BANK("Fixed bank") - PRINTLN "@: {X}\nStr: {Y}" + PRINTLN "@: {X}\nStr: {Y}" -ERR = BANK(@) + DEF ERR = BANK(@) diff --git a/test/asm/raw-macro-args.asm b/test/asm/raw-macro-args.asm index b633418b01..658ee28a58 100644 --- a/test/asm/raw-macro-args.asm +++ b/test/asm/raw-macro-args.asm @@ -12,8 +12,8 @@ MACRO printlit endr ENDM -NUM EQU 42 -STR EQUS "str\"ing" +DEF NUM EQU 42 +DEF STR EQUS "str\"ing" printargs NUM printargs "{d:NUM}" diff --git a/test/asm/redef-equ.asm b/test/asm/redef-equ.asm index 36abff5ae5..012cdd64e9 100644 --- a/test/asm/redef-equ.asm +++ b/test/asm/redef-equ.asm @@ -4,7 +4,7 @@ REDEF n EQU 1 PRINTLN n MACRO list -LIST_NAME EQUS "\1" +DEF LIST_NAME EQUS "\1" DEF LENGTH_{LIST_NAME} EQU 0 ENDM @@ -19,5 +19,5 @@ ENDM item 9 println LENGTH_SQUARES, SQUARES_1, SQUARES_2, SQUARES_3 -N EQUS "X" +DEF N EQUS "X" REDEF N EQU 42 diff --git a/test/asm/redef-equs.asm b/test/asm/redef-equs.asm index 012ec5555c..6b662ef5a0 100644 --- a/test/asm/redef-equs.asm +++ b/test/asm/redef-equs.asm @@ -1,10 +1,10 @@ -s EQUS "Hello, " +DEF s EQUS "Hello, " REDEF s EQUS "{s}world!" ; prints "Hello, world!" PRINTLN "{s}" MACRO list -LIST_NAME EQUS "\1" +DEF LIST_NAME EQUS "\1" REDEF {LIST_NAME} EQUS "[" REPT _NARG - 1 REDEF {LIST_NAME} EQUS "{{LIST_NAME}}\2;" @@ -19,5 +19,5 @@ ENDM list FOO, 1, A, 2, B PRINTLN "{FOO}" -N EQU 42 +DEF N EQU 42 REDEF N EQUS "X" diff --git a/test/asm/ref-override-bad.asm b/test/asm/ref-override-bad.asm index ca3277c6d2..6ff87e542e 100644 --- a/test/asm/ref-override-bad.asm +++ b/test/asm/ref-override-bad.asm @@ -2,10 +2,10 @@ SECTION "Bad!", ROM0 db W -W equ 0 ; OK +def W equ 0 ; OK db X -X equs "0" ; Not OK +def X equs "0" ; Not OK db Y macro Y ; Not ok diff --git a/test/asm/ref-override.asm b/test/asm/ref-override.asm index dfad75bd99..9187b2c906 100644 --- a/test/asm/ref-override.asm +++ b/test/asm/ref-override.asm @@ -1,4 +1,4 @@ SECTION "Test", ROM0[0] db CONSTANT -CONSTANT equ 42 +def CONSTANT equ 42 diff --git a/test/asm/rs.asm b/test/asm/rs.asm index 694f3f334f..4e747f280d 100644 --- a/test/asm/rs.asm +++ b/test/asm/rs.asm @@ -1,7 +1,7 @@ -a1 rb 1 -a2 rw 1 -a3 rl 1 +def a1 rb 1 +def a2 rw 1 +def a3 rl 1 PRINTLN "a1 = ", a1 PRINTLN "a2 = ", a2 @@ -9,9 +9,9 @@ PRINTLN "a3 = ", a3 PRINTLN "_RS = ", _RS -b1 rb 1 -b2 rw 1 -b3 rl 1 +def b1 rb 1 +def b2 rw 1 +def b3 rl 1 PRINTLN "b1 = ", b1 PRINTLN "b2 = ", b2 @@ -20,9 +20,9 @@ PRINTLN "_RS = ", _RS rsset 42 -c1 rb 1 -c2 rw 1 -c3 rl 1 +def c1 rb 1 +def c2 rw 1 +def c3 rl 1 PRINTLN "c1 = ", c1 PRINTLN "c2 = ", c2 @@ -31,13 +31,11 @@ PRINTLN "_RS = ", _RS rsreset -d1 rb 1 -d2 rw 1 -d3 rl 1 +def d1 rb 1 +def d2 rw 1 +def d3 rl 1 PRINTLN "d1 = ", d1 PRINTLN "d2 = ", d2 PRINTLN "d3 = ", d3 PRINTLN "_RS = ", _RS - - diff --git a/test/asm/section-sizeof-startof.asm b/test/asm/section-sizeof-startof.asm index 371fae01ca..bd09bdc616 100644 --- a/test/asm/section-sizeof-startof.asm +++ b/test/asm/section-sizeof-startof.asm @@ -1,33 +1,33 @@ SECTION "sect", ROMX[$4567], BANK[$23] ds 42 -W = BANK("sect") -X = SIZEOF("sect") ; unknown -Y = STARTOF("sect") +DEF W = BANK("sect") +DEF X = SIZEOF("sect") ; unknown +DEF Y = STARTOF("sect") println "sect1: {W} {X} {Y}" SECTION "sect2", ROMX -W = BANK("sect") -X = SIZEOF("sect") -Y = STARTOF("sect") +DEF W = BANK("sect") +DEF X = SIZEOF("sect") +DEF Y = STARTOF("sect") println "sect1: {W} {X} {Y}" PUSHS SECTION FRAGMENT "sect3", ROMX[$4567], BANK[$12] -W = BANK("sect2") ; unknown -X = SIZEOF("sect2") ; unknown -Y = STARTOF("sect2") ; unknown +DEF W = BANK("sect2") ; unknown +DEF X = SIZEOF("sect2") ; unknown +DEF Y = STARTOF("sect2") ; unknown println "sect2: {W} {X} {Y}" POPS -W = BANK("sect3") -X = SIZEOF("sect3") ; unknown -Y = STARTOF("sect3") +DEF W = BANK("sect3") +DEF X = SIZEOF("sect3") ; unknown +DEF Y = STARTOF("sect3") println "sect3: {W} {X} {Y}" diff --git a/test/asm/section-union.asm b/test/asm/section-union.asm index a0f74b639f..c4ca29b4cb 100644 --- a/test/asm/section-union.asm +++ b/test/asm/section-union.asm @@ -17,11 +17,11 @@ SECTION UNION "test", WRAM0,ALIGN[9] MACRO check_label -EXPECTED equ \2 + def EXPECTED equ \2 IF \1 == EXPECTED -RESULT equs "OK!" + def RESULT equs "OK!" ELSE -RESULT equs "expected {EXPECTED}" + def RESULT equs "expected {EXPECTED}" ENDC PURGE EXPECTED diff --git a/test/asm/shift-negative.asm b/test/asm/shift-negative.asm index 41be00bc52..439d19c482 100644 --- a/test/asm/shift-negative.asm +++ b/test/asm/shift-negative.asm @@ -1,6 +1,6 @@ MACRO reverse for i, _NARG -i = _NARG - i - 1 + def i = _NARG - i - 1 shift i println \1 shift -i diff --git a/test/asm/strfmt.asm b/test/asm/strfmt.asm index 988835781e..0e7c9a8f1d 100644 --- a/test/asm/strfmt.asm +++ b/test/asm/strfmt.asm @@ -1,14 +1,14 @@ -VAL EQUS STRFMT("Hello %s! I am %d years old today!", "world", $f) +DEF VAL EQUS STRFMT("Hello %s! I am %d years old today!", "world", $f) PRINTLN "{VAL}" -N = -42 +DEF N = -42 PRINTLN STRFMT("signed %010d == unsigned %010u", N, N) -N = 112 -FMT EQUS "X" +DEF N = 112 +DEF FMT EQUS "X" PRINTLN STRFMT("\tdb %#03{s:FMT} %% 26\t; %#03{FMT}", N, N % 26) -TEMPLATE EQUS "\"%s are %s\\n\"" +DEF TEMPLATE EQUS "\"%s are %s\\n\"" PRINT STRFMT(TEMPLATE, "roses", "red") PRINT STRFMT(TEMPLATE, "violets", "blue") PRINT STRFMT(TEMPLATE, "void", 0, "extra") @@ -16,7 +16,7 @@ PRINT STRFMT(TEMPLATE, "void", 0, "extra") PRINTLN STRCAT(STRFMT(STRFMT("%%%s.%d%s", "", 9, "f"), 3.14159), \ STRFMT(" ~ %s", STRFMT("%s%x", "thr", 238))) -N = 1.23456 +DEF N = 1.23456 PRINTLN STRFMT("%.f -> %.3f -> %f", N, N, N) PRINTLN STRFMT("%d eol %", 1) diff --git a/test/asm/string-formatting.asm b/test/asm/string-formatting.asm index 4731a5069a..aeed5d1140 100644 --- a/test/asm/string-formatting.asm +++ b/test/asm/string-formatting.asm @@ -1,8 +1,8 @@ -n equ 300 -m equ -42 -f equ -123.0456 -pi equ 3.14159 -s equs "hello" +def n equ 300 +def m equ -42 +def f equ -123.0456 +def pi equ 3.14159 +def s equs "hello" println "<{ -6d:n}> <{+06u:n}> <{5x:n}> <{#16b:n}>" println "<{u:m}> <{+3d:m}> <{#016o:m}>" diff --git a/test/asm/strupr-strlwr.asm b/test/asm/strupr-strlwr.asm index 6728adeec9..c5fa42258c 100644 --- a/test/asm/strupr-strlwr.asm +++ b/test/asm/strupr-strlwr.asm @@ -1,4 +1,4 @@ -foo equs strupr("xii") -bar equs strlwr("LOL") +def foo equs strupr("xii") +def bar equs strlwr("LOL") println "foo={foo} bar={bar}" diff --git a/test/asm/symbol-invalid-macro-arg.asm b/test/asm/symbol-invalid-macro-arg.asm index 8cad5843f2..80b647028d 100644 --- a/test/asm/symbol-invalid-macro-arg.asm +++ b/test/asm/symbol-invalid-macro-arg.asm @@ -1,2 +1,2 @@ -x\0 = 10 +def x\0 = 10 println x diff --git a/test/asm/symbol-override.asm b/test/asm/symbol-override.asm index 969e7d5f91..4b249926fa 100644 --- a/test/asm/symbol-override.asm +++ b/test/asm/symbol-override.asm @@ -1,14 +1,14 @@ -V = 0 -V = 1 +def V = 0 +def V = 1 PRINTLN "V={V}" -W equ 1 -W = 0 +def W equ 1 +def W = 0 rsset 1 -X rb 0 -X = 0 +def X rb 0 +def X = 0 SECTION "Test", ROM0[1] Y: -Y = 0 +def Y = 0 diff --git a/test/asm/syntax-error-lexer-mode.asm b/test/asm/syntax-error-lexer-mode.asm index 16af9a3c09..f1993eff4f 100644 --- a/test/asm/syntax-error-lexer-mode.asm +++ b/test/asm/syntax-error-lexer-mode.asm @@ -1,4 +1,4 @@ -newline equs "\n" +def newline equs "\n" def x = 1 newline def y = 2 println "x={d:x}, y={d:y}" diff --git a/test/asm/unique-id.asm b/test/asm/unique-id.asm index c856721415..f5c84419a7 100644 --- a/test/asm/unique-id.asm +++ b/test/asm/unique-id.asm @@ -1,4 +1,4 @@ -warn_unique EQUS "WARN \"\\@!\"" +DEF warn_unique EQUS "WARN \"\\@!\"" macro m warn_unique diff --git a/test/asm/utc-time.asm b/test/asm/utc-time.asm index 30d80fb798..38c56ae6c5 100644 --- a/test/asm/utc-time.asm +++ b/test/asm/utc-time.asm @@ -9,6 +9,6 @@ ENDM between 0, __UTC_MINUTE__, 59 between 0, __UTC_SECOND__, 60 ; leap seconds! -UTC_TIME EQUS STRCAT("{04d:__UTC_YEAR__}-{02d:__UTC_MONTH__}-{02d:__UTC_DAY__}T", \ +DEF UTC_TIME EQUS STRCAT("{04d:__UTC_YEAR__}-{02d:__UTC_MONTH__}-{02d:__UTC_DAY__}T", \ "{02d:__UTC_HOUR__}:{02d:__UTC_MINUTE__}:{02d:__UTC_SECOND__}Z") assert !STRCMP("{UTC_TIME}", __ISO_8601_UTC__) diff --git a/test/asm/warn-truncation.asm b/test/asm/warn-truncation.asm index 272dad738c..e394026d9a 100644 --- a/test/asm/warn-truncation.asm +++ b/test/asm/warn-truncation.asm @@ -1,5 +1,5 @@ -FOO_F EQU 5 -BAR_F EQU 7 +DEF FOO_F EQU 5 +DEF BAR_F EQU 7 SECTION "RAM", WRAMX[$d500] diff --git a/test/link/all-instructions.asm b/test/link/all-instructions.asm index bdc744ba9f..0f7eb83052 100644 --- a/test/link/all-instructions.asm +++ b/test/link/all-instructions.asm @@ -57,7 +57,7 @@ ENDM ; Bit Operations Instructions MACRO bitop_u3_instruction_list -NBIT = 0 + DEF NBIT = 0 REPT 8 \1 NBIT,a \1 NBIT,b @@ -67,7 +67,7 @@ NBIT = 0 \1 NBIT,h \1 NBIT,[hl] \1 NBIT,l -NBIT = NBIT + 1 + DEF NBIT = NBIT + 1 ENDR ENDM diff --git a/test/link/bank-const/a.asm b/test/link/bank-const/a.asm index 3590ea579b..4656c29c70 100644 --- a/test/link/bank-const/a.asm +++ b/test/link/bank-const/a.asm @@ -1,2 +1,2 @@ -CONSTANT equ 0 +def CONSTANT equ 0 EXPORT CONSTANT diff --git a/test/link/section-union/align-conflict.asm b/test/link/section-union/align-conflict.asm index 7a92349be2..c5784e9b53 100644 --- a/test/link/section-union/align-conflict.asm +++ b/test/link/section-union/align-conflict.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -ATTRS equs ",ALIGN[2]" + def ATTRS equs ",ALIGN[2]" ELSE -ATTRS equs "[$CAFE]" + def ATTRS equs "[$CAFE]" ENDC SECTION UNION "conflicting alignment", WRAM0 ATTRS diff --git a/test/link/section-union/align-ofs-conflict.asm b/test/link/section-union/align-ofs-conflict.asm index 144f7e865f..1f32122080 100644 --- a/test/link/section-union/align-ofs-conflict.asm +++ b/test/link/section-union/align-ofs-conflict.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -ATTRS equs ",ALIGN[3,7]" + def ATTRS equs ",ALIGN[3,7]" ELSE -ATTRS equs ",ALIGN[4,14]" + def ATTRS equs ",ALIGN[4,14]" ENDC SECTION UNION "conflicting alignment", WRAM0 ATTRS diff --git a/test/link/section-union/assert.asm b/test/link/section-union/assert.asm index 91b745d7be..969713bd43 100644 --- a/test/link/section-union/assert.asm +++ b/test/link/section-union/assert.asm @@ -1,10 +1,10 @@ IF !DEF(SECOND) -OFS = 42 + def OFS = 42 ELSE -OFS = 69 + def OFS = 69 ENDC -BASE = $C0DE +def BASE = $C0DE SECTION UNION "assertions in unions", WRAM0 IF DEF(SECOND) diff --git a/test/link/section-union/bad-types.asm b/test/link/section-union/bad-types.asm index e8c2e5f9b9..efa914d831 100644 --- a/test/link/section-union/bad-types.asm +++ b/test/link/section-union/bad-types.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -TYPE equs "HRAM" + def TYPE equs "HRAM" ELSE -TYPE equs "WRAM0" + def TYPE equs "WRAM0" ENDC SECTION UNION "conflicting types", TYPE diff --git a/test/link/section-union/bank-conflict.asm b/test/link/section-union/bank-conflict.asm index cc5c6aaca9..d14f834a03 100644 --- a/test/link/section-union/bank-conflict.asm +++ b/test/link/section-union/bank-conflict.asm @@ -1,5 +1,5 @@ IF !DEF(SECOND) -SECOND equs "4" + def SECOND equs "4" ENDC SECTION UNION "conflicting banks", WRAMX, BANK[SECOND] diff --git a/test/link/section-union/data-overlay.asm b/test/link/section-union/data-overlay.asm index be65b67ec3..049c4f8dbd 100644 --- a/test/link/section-union/data-overlay.asm +++ b/test/link/section-union/data-overlay.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -DATA equs "ds 4" + def DATA equs "ds 4" ELSE -DATA equs "db $aa, $bb, $cc, $dd" + def DATA equs "db $aa, $bb, $cc, $dd" ENDC SECTION UNION "overlaid data", ROM0 diff --git a/test/link/section-union/different-data.asm b/test/link/section-union/different-data.asm index ca6b153754..ca5f079872 100644 --- a/test/link/section-union/different-data.asm +++ b/test/link/section-union/different-data.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -DATA = 1 + def DATA = 1 ELSE -DATA = 2 + def DATA = 2 ENDC SECTION UNION "different data", ROM0 diff --git a/test/link/section-union/different-ofs.asm b/test/link/section-union/different-ofs.asm index a288ba6861..29241e3815 100644 --- a/test/link/section-union/different-ofs.asm +++ b/test/link/section-union/different-ofs.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -ATTRS equs ",ALIGN[3,7]" + def ATTRS equs ",ALIGN[3,7]" ELSE -ATTRS equs ",ALIGN[3,6]" + def ATTRS equs ",ALIGN[3,6]" ENDC SECTION UNION "conflicting alignment", WRAM0 ATTRS diff --git a/test/link/section-union/different-size.asm b/test/link/section-union/different-size.asm index 6514bf9320..f221b08ccb 100644 --- a/test/link/section-union/different-size.asm +++ b/test/link/section-union/different-size.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -SIZE = 69 + def SIZE = 69 ELSE -SIZE = 420 + def SIZE = 420 ENDC SECTION UNION "different section sizes", ROM0 diff --git a/test/link/section-union/different-syntaxes.asm b/test/link/section-union/different-syntaxes.asm index d261d21f8d..d139952d30 100644 --- a/test/link/section-union/different-syntaxes.asm +++ b/test/link/section-union/different-syntaxes.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -INSTR equs "sbc a" + def INSTR equs "sbc a" ELSE -INSTR equs "db $9f" + def INSTR equs "db $9f" ENDC SECTION UNION "different syntaxes", ROM0 diff --git a/test/link/section-union/org-conflict.asm b/test/link/section-union/org-conflict.asm index b51635b38a..151f9e8830 100644 --- a/test/link/section-union/org-conflict.asm +++ b/test/link/section-union/org-conflict.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -ADDR = $BEEF + def ADDR = $BEEF ELSE -ADDR = $BABE + def ADDR = $BABE ENDC SECTION UNION "conflicting address", SRAM[ADDR] diff --git a/test/link/section-union/split-data.asm b/test/link/section-union/split-data.asm index 2ddff42086..fc372fb770 100644 --- a/test/link/section-union/split-data.asm +++ b/test/link/section-union/split-data.asm @@ -1,7 +1,7 @@ IF !DEF(SECOND) -DATA equs "ds 1\ndb $aa" + def DATA equs "ds 1\ndb $aa" ELSE -DATA equs "db $bb\nds 1" + def DATA equs "db $bb\nds 1" ENDC SECTION UNION "mutually-overlaid data", ROM0