Rev 129 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download
# file opened: defarray_add.asm
1 0000 ; this test does not only test newly added "DEFARRAY+", but also tests syntax error reports
2 0000 DEFARRAY myarray 'A', 'B', 'C'
3 0000 DEFARRAY+ myarray 'D', 'E', 'F'
4 0000
5 0000 OUTPUT 'defarray_add.bin' ; emit all six items into file to check content
6 0000 CNT=0
7 0000 DUP 6
8 0000 41 > db 'A'
9 0001 >CNT=CNT+1
8 0001 42 > db 'B'
9 0002 >CNT=CNT+1
8 0002 43 > db 'C'
9 0003 >CNT=CNT+1
8 0003 44 > db 'D'
9 0004 >CNT=CNT+1
8 0004 45 > db 'E'
9 0005 >CNT=CNT+1
8 0005 46 > db 'F'
9 0006 >CNT=CNT+1
10 0006 EDUP
11 0006
12 0006 ; error tests (also for regular DEFARRAY, as it was not tested much before)
defarray_add.asm(13): error: [DEFARRAY] Syntax error in <id>:
13 0006 DEFARRAY
defarray_add.asm(14): error: [DEFARRAY] Syntax error in <id>:
14 0006 DEFARRAY+
defarray_add.asm(15): error: Duplicate define (replacing old value): myarray
15 0006 DEFARRAY myarray 'X', 'Y', 'Z' ; duplicate definition
defarray_add.asm(16): error: [DEFARRAY+] unknown array <id>: noneId
16 0006 DEFARRAY+ noneId 'D', 'E', 'F' ; undefined id
defarray_add.asm(17): error: [DEFARRAY] must have at least one entry
17 0006 DEFARRAY noneId ; empty values
defarray_add.asm(18): error: [DEFARRAY] must have at least one entry
18 0006 DEFARRAY+ myarray ; empty values
defarray_add.asm(19): error: [ARRAY] index not in 0..<Size-1> range: myarray[3]
19 0006 db
defarray_add.asm(20): error: [ARRAY] index not in 0..<Size-1> range: myarray[-1]
20 0006 db
defarray_add.asm(21): error: Syntax error: noneId[0]
21 0006 db noneId[0]
defarray_add.asm(22): error: [DEFARRAY] missing space between <id> and first <item>: +48
22 0006 DEFARRAY myarray+48 ; enforce white space between ID and first value
defarray_add.asm(23): error: [DEFARRAY] missing space between <id> and first <item>: +49
23 0006 DEFARRAY+ myarray+49 ; enforce white space between ID and first value
24 0006
# file closed: defarray_add.asm
Value Label
------ - -----------------------------------------------------------
0x0006 CNT