# file opened: numeric_constants_invalid.asm
 1    0000                  ;; invalid numeric literals errors
 2    0000
 3    0000                  ;; missing digits
numeric_constants_invalid.asm(4): error: [DWORD] Syntax error: #
 4    0000                  DD      #
 5    0000                  ;DD $   => is actual valid syntax for current address pointer
numeric_constants_invalid.asm(6): error: Syntax error: 0x
 6    0000                  DD      0x
numeric_constants_invalid.asm(7): error: Syntax error: %
 7    0000                  DD      %
 8    0000
 9    0000                  ;; hard 32b overflow
10    0000 FF FF FF FF      DD      0xFFFFFFFF                          ; OK
numeric_constants_invalid.asm(11): error: Overflow: 0x100000000
11    0004 00 00 00 00      DD      0x100000000                         ; overflow error
12    0008 FF FF FF FF      DD      %11111111111111111111111111111111   ; OK
numeric_constants_invalid.asm(13): error: Overflow: %100000000000000000000000000000000
13    000C 00 00 00 00      DD      %100000000000000000000000000000000  ; overflow error
14    0010 FF FF FF FF      DD      37777777777o                        ; OK
numeric_constants_invalid.asm(15): error: Overflow: 40000000000o
15    0014 00 00 00 00      DD      40000000000o                        ; overflow error
16    0018 FF FF FF FF      DD      4294967295                          ; OK
numeric_constants_invalid.asm(17): error: Overflow: 4294967296
17    001C 00 00 00 00      DD      4294967296                          ; overflow error
18    0020
19    0020                  ;; digit out of base
numeric_constants_invalid.asm(20): error: Digit not in base: 12A0
20    0020                  DD      12A0
numeric_constants_invalid.asm(21): error: Digit not in base: 12A0d
21    0020                  DD      12A0d
numeric_constants_invalid.asm(22): error: Digit not in base: 0FFGFh
22    0020                  DD      0FFGFh
numeric_constants_invalid.asm(23): error: Digit not in base: 0xFFGF
23    0020                  DD      0xFFGF
numeric_constants_invalid.asm(24): error: Digit not in base: $FFGF
24    0020                  DD      $FFGF
numeric_constants_invalid.asm(25): error: Digit not in base: #FFGF
25    0020                  DD      #FFGF
numeric_constants_invalid.asm(26): error: Digit not in base: 1002001b
26    0020                  DD      1002001b
numeric_constants_invalid.asm(27): error: Digit not in base: 01002001b
27    0020                  DD      01002001b
numeric_constants_invalid.asm(28): error: Digit not in base: %1002001
28    0020                  DD      %1002001
numeric_constants_invalid.asm(29): error: Digit not in base: %01002001
29    0020                  DD      %01002001
numeric_constants_invalid.asm(30): error: Digit not in base: 12834q
30    0020                  DD      12834q
numeric_constants_invalid.asm(31): error: Digit not in base: 12834o
31    0020                  DD      12834o
32    0020
33    0020                  ;; since v1.20.0 the parser does recognise decimal part of the constant and throws it away with warning
34    0020                  ;; this is crude work-around to help migrate Lua 5.1 scripts, as those now format values like 2^7 as "128.0"
35    0020                  OPT -Wdecimalz
numeric_constants_invalid.asm(36): warning[decimalz]: decimal part is ignored: 12.0
36    0020 0C               DB      12.0
numeric_constants_invalid.asm(37): warning[decimalz]: decimal part is ignored: $AB.0
37    0021 AB               DB      $AB.0
numeric_constants_invalid.asm(38): warning[decimalz]: decimal part is ignored: %101.0
38    0022 05               DB      %101.0
numeric_constants_invalid.asm(39): warning[decimalz]: decimal part is ignored: 0q77.0
39    0023 3F               DB      0q77.0
numeric_constants_invalid.asm(40): warning[decimaln]: decimal part is ignored: 12.03
40    0024 0C               DB      12.03
numeric_constants_invalid.asm(41): warning[decimaln]: decimal part is ignored: $AB.0E
41    0025 AB               DB      $AB.0E
numeric_constants_invalid.asm(42): warning[decimaln]: decimal part is ignored: %101.01
42    0026 05               DB      %101.01
numeric_constants_invalid.asm(43): warning[decimaln]: decimal part is ignored: 0q77.01
43    0027 3F               DB      0q77.01
44    0028                  LUA ALLPASS     ; warning vs integer variant
45    0028 ~                    _pc("db " .. 2^7 .. " , " .. (1<<7))    -- "1<<7" is integer variant of "2^7"
46    0028 ~                    _pc("db " .. string.format("%.6f", 2^7.00001) .. " , " .. math.floor(2^7.00001))
47    0028 ~                    _pc("db " .. 35/7 .. " , " .. 35//7)    -- "35//7" is integer variant of "35/7"
48    0028 ~                    _pc("db " .. string.format("%.6f", 36/7) .. " , " .. 36//7)    -- "36//7" is integer variant of "36/7"
numeric_constants_invalid.asm(45): warning[decimalz]: [LUA] decimal part is ignored: 128.0 , 128
49    0028 80 80        db 128.0 , 128
numeric_constants_invalid.asm(46): warning[decimaln]: [LUA] decimal part is ignored: 128.000887 , 128
49    002A 80 80        db 128.000887 , 128
numeric_constants_invalid.asm(47): warning[decimalz]: [LUA] decimal part is ignored: 5.0 , 5
49    002C 05 05        db 5.0 , 5
numeric_constants_invalid.asm(48): warning[decimaln]: [LUA] decimal part is ignored: 5.142857 , 5
49    002E 05 05        db 5.142857 , 5
49    0030                  ENDLUA
numeric_constants_invalid.asm(50): warning[decimalz]: decimal part is ignored: 12.0'0
50    0030 0C               DB      12.0'0
numeric_constants_invalid.asm(51): warning[decimaln]: decimal part is ignored: 12.0'1
51    0031 0C               DB      12.0'1
52    0032                  ; errors when decimal part has invalid digit
numeric_constants_invalid.asm(53): error: Digit not in base: .A
53    0032                  DB      12.A
numeric_constants_invalid.asm(54): error: Digit not in base: .G
54    0032                  DB      $AB.G
numeric_constants_invalid.asm(55): error: Digit not in base: .2
55    0032                  DB      %101.2
numeric_constants_invalid.asm(56): error: Digit not in base: .8
56    0032                  DB      0q77.8
57    0032                  ; code coverage: make sure the overflow in decimal part doesn't affect other warnings/reporting and is silently ignored
numeric_constants_invalid.asm(58): warning[decimalz]: decimal part is ignored: 15.0'000'000'000'000'000'000
58    0032 0F               DB      15.0'000'000'000'000'000'000
numeric_constants_invalid.asm(59): warning[decimaln]: decimal part is ignored: 15.0'999'999'999'999'999'999
59    0033 0F               DB      15.0'999'999'999'999'999'999
60    0034
# file closed: numeric_constants_invalid.asm

Value    Label
------ - -----------------------------------------------------------
