diff --git a/tests/test-asciz.lst.ok b/tests/test-asciz.lst.ok new file mode 100644 index 0000000..c89685d --- /dev/null +++ b/tests/test-asciz.lst.ok @@ -0,0 +1,57 @@ + 1 ;;;;; + 2 ; + 3 ; Test delimiters of .ASCII and .ASCIZ + 4 + 5 000015 CR = 13. + 6 000012 LF = 10. + 7 000001 SOH = 1 + 8 + 9 000000 015 012 074 .asciz // ; 2 bytes and a string + 000003 123 117 110 + 000006 076 000 + 10 000010 074 143 162 .asciz // ; only a string + 000013 076 074 154 + 000016 146 076 074 + 000021 123 117 110 + 000024 076 000 + 11 000026 074 143 162 .asciz || ; the same string + 000031 076 074 154 + 000034 146 076 074 + 000037 123 117 110 + 000042 076 000 + 12 000044 015 012 001 .ascii ; 3 bytes + 13 + 14 000047 101 102 103 .asciz ;ABC;/DEF/ ; ABCDEF, not recommended practice + 000052 104 105 106 + 000055 000 + 15 000056 101 102 103 .asciz /ABC/;DEF; ; ABC, not recommended practice + 000061 000 + 16 000062 101 102 103 .asciz /ABC/=DEF= ; ABCDEF, not recommended practice + 000065 104 105 106 + 000070 000 +test-asciz.mac:17: ***ERROR Complex expression cannot be assigned to a symbol + 17 .asciz =DEF= ; syntax error: assignment +test-asciz.mac:18: ***ERROR Complex expression cannot be assigned to a symbol + 18 .asciz =###= ; syntax error: assignment +test-asciz.mac:19: ***ERROR .WORD on odd boundary +test-asciz.mac:19: ***ERROR Invalid expression + 19 000071 000 000001 000000 .asciz :SOH: ; syntax error: colon not allowed +test-asciz.mac:20: ***ERROR Illegal symbol definition .ASCIZ +test-asciz.mac:20: ***ERROR Invalid expression +test-asciz.mac:20: ***ERROR Invalid expression +test-asciz.mac:20: ***ERROR Invalid expression +test-asciz.mac:20: ***ERROR Invalid expression + 20 000076 000000 000000 000000 .asciz :###: ; syntax error: colon not allowed + 000104 000000 + 20 + + +Symbol table + +. ******R 001 .ASCIZ 000071R 001 CR =000015 LF =000012 SOH =000001 + + +Program sections: + +. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) + 000106 001 (RW,I,LCL,REL,CON,NOSAV) diff --git a/tests/test-backpatch.lst.ok b/tests/test-backpatch.lst.ok new file mode 100644 index 0000000..d002d17 --- /dev/null +++ b/tests/test-backpatch.lst.ok @@ -0,0 +1,30 @@ + 1 ;;;; + 2 ; + 3 ; Test backpatching (seen in Kermit sources). + 4 + 5 000000 .psect modinf ,ro,d,lcl,rel,con + 6 + 7 000000 label = . + 8 000000 .blkb 50 ; create some data + 9 + 10 000050 050 051 052 .byte 50,51,52 ; and some more + 11 .save ; we're at 53 now + 12 000053 .psect modinf + 13 000006 . = label + 6 + 14 000006 000006 .word 6 ; stored at 6 + 15 000053 .restore ; . gets restored to 53 + 16 000053 053 .byte 53 + 17 + 17 + + +Symbol table + +. ******R 002 LABEL 000000R 002 + + +Program sections: + +. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) + 000000 001 (RW,I,LCL,REL,CON,NOSAV) +MODINF 000054 002 (RO,D,LCL,REL,CON,NOSAV) diff --git a/tests/test-bsl-mac-arg.lst.ok b/tests/test-bsl-mac-arg.lst.ok new file mode 100644 index 0000000..8ea3939 --- /dev/null +++ b/tests/test-bsl-mac-arg.lst.ok @@ -0,0 +1,49 @@ + 1 .list me + 2 .macro test x + 3 .blkb x ; test some directive that wants an expression + 4 .endm + 5 + 6 000010 size = 10 + 7 000002 foo = 2 + 8 + 9 ; likes: + 10 + 11 000000 test size ; not replaced by "10" + 1 000000 .blkb size ; test some directive that wants an expression + 12 000010 test \size ; replaced by "10" + 1 000010 .blkb 10 ; test some directive that wants an expression + 13 000020 test \ ; ditto + 1 000020 .blkb 10 ; test some directive that wants an expression + 14 000030 test \ ; replaced by "12" + 1 000030 .blkb 12 ; test some directive that wants an expression + 15 000042 test ^/size + foo/ ; arg is "size + foo", not "12" + 1 000042 .blkb size + foo ; test some directive that wants an expression + 16 + 17 ; dislikes: + 18 + 19 000054 test <\size> ; parameter is \size, which might be ok for +test-bsl-mac-arg.mac:19->TEST:1: ***ERROR Argument to .BLKB/.BLKW must be constant + 1 .blkb \size ; test some directive that wants an expression + 20 ; macros where the argument is used differently. + 21 000054 test size + foo ; gets split at the space + 1 000054 .blkb size ; test some directive that wants an expression + 22 000064 test /size + foo/ ; gets split at the space +test-bsl-mac-arg.mac:22->TEST:1: ***ERROR Argument to .BLKB/.BLKW must be constant + 1 .blkb /size ; test some directive that wants an expression +test-bsl-mac-arg.mac:23: ***ERROR Constant value required + 23 000064 test \/size + foo/ ; invalid expression with division operator + 1 000064 .blkb 0 ; test some directive that wants an expression + 24 000064 test \^/size + foo/ ; original dislikes this, but we accept it. + 1 000064 .blkb 12 ; test some directive that wants an expression + 24 + + +Symbol table + +. ******R 001 FOO =000002 SIZE =000010 + + +Program sections: + +. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) + 000076 001 (RW,I,LCL,REL,CON,NOSAV) diff --git a/tests/test-complex-reloc.objd.ok b/tests/test-complex-reloc.objd.ok new file mode 100644 index 0000000..8efc8f7 --- /dev/null +++ b/tests/test-complex-reloc.objd.ok @@ -0,0 +1,26 @@ +GSD: + GLOBAL IE.ITS=0 REF ABS flags=100 + GLOBAL IE.MON=0 REF ABS flags=100 + MODNAME .MAIN.=0 flags=0 + PSECT =30 CON RW REL LCL I flags=40 + PSECT . ABS.=0 OVR RW ABS GBL I flags=104 + XFER . ABS.=1 flags=10 +ENDGSD +RLD + Location counter definition +0 +TEXT ADDR=0 LEN=30 + 000000: 012767 000000 000000 000000 ........ + 000010: 000000 000000 000000 000000 ........ + 000020: 000000 000000 000000 000000 ........ +RLD + Complex 2=IE.ITS neg store + Global 6=IE.ITS + Complex 10=IE.ITS neg store + Complex 12=IE.ITS ^C store + Complex 14=IE.ITS IE.MON + store + Complex 16=IE.ITS IE.MON - store + Complex 20=IE.ITS IE.MON * store + Complex 22=IE.ITS IE.MON / store + Complex 24=IE.ITS IE.MON & store + Complex 26=IE.ITS IE.MON ! store +ENDMOD diff --git a/tests/test-endm.lst.ok b/tests/test-endm.lst.ok new file mode 100644 index 0000000..b255ab0 --- /dev/null +++ b/tests/test-endm.lst.ok @@ -0,0 +1,67 @@ + 1 ;;;;; + 2 ; + 3 ; Test nested macros and name on .ENDM + 4 ; + 5 + 6 .macro M1 + 7 .word 1 + 8 .endm M1 ; ok + 9 + 10 000000 M1 + 1 000000 000001 .word 1 + 11 + 12 .macro M2 + 13 .word 2 + 14 .macro M3 + 15 .word 3 + 16 .endm M3 ; ok + 17 .endm M2 ; ok + 18 + 19 000002 M2 + 1 000002 000002 .word 2 + 2 .macro M3 + 3 .word 3 + 4 .endm M3 ; ok + 20 000004 M3 + 1 000004 000003 .word 3 + 21 + 22 .macro M4 + 23 .word 4 + 24 .macro M4 + 25 .endm M4 ; ok + 26 .endm M4 ; ok + 27 + 28 000006 M4 + 1 000006 000004 .word 4 + 2 .macro M4 + 3 .endm M4 ; ok + 29 000010 M4 ; should be empty now + 30 + 31 .macro M5 + 32 .word 5 + 33 .macro M5 + 34 .endm notM5 ; wrong; detected when M5 is expanded + 35 .endm M5 ; ok + 36 + 37 000010 M5 + 1 000010 000005 .word 5 + 2 .macro M5 +test-endm.mac:37->M5:3: ***ERROR .ENDM 'NOTM5' does not match .MACRO 'M5' + 3 .endm notM5 ; wrong; detected when M5 is expanded + 38 000012 M5 + 39 + 40 .macro M6 +test-endm.mac:41: ***ERROR .ENDM 'NOTM6' does not match .MACRO 'M6' + 41 .endm notM6 ; wrong + 41 + + +Symbol table + +. ******R 001 + + +Program sections: + +. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) + 000012 001 (RW,I,LCL,REL,CON,NOSAV) diff --git a/tests/test-impword.lst.ok b/tests/test-impword.lst.ok new file mode 100644 index 0000000..62ee090 --- /dev/null +++ b/tests/test-impword.lst.ok @@ -0,0 +1,26 @@ + 1 ;;;;; + 2 ; + 3 ; Test the implied .word construction + 4 ; + 5 + 6 000000 000003 start: 3 + 7 000002 000000' start + 8 ; The following could be a macro which by accident is not defined + 9 ; which takes arguments that don't parse as expressions. +test-impword.mac:10: ***ERROR Invalid expression in .WORD + 10 000004 000000G macro 8-BIT,1,2,3 + 11 ; The following can by accident be parsed as an expression. + 12 000006 000000G 150007 000001 macro 7-BIT,1,2,3 + 000014 000002 000003 + 12 + + +Symbol table + +. ******R 001 MACRO =****** GX START 000000R 001 + + +Program sections: + +. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) + 000020 001 (RW,I,LCL,REL,CON,NOSAV) diff --git a/tests/test-include.lst.ok b/tests/test-include.lst.ok new file mode 100644 index 0000000..a5b991f --- /dev/null +++ b/tests/test-include.lst.ok @@ -0,0 +1,62 @@ + 1 ;;;;; + 2 ; + 3 ; Test some delimiters for the .INCLUDE directive + 4 ; + 5 + 6 .include "incl.mac" + 1 ;;;;; + 2 ; + 3 ; file to be included + 4 + 5 000000 000001 .word 1 ; to show it is included + 5 + 7 .include /incl.mac/ + 1 ;;;;; + 2 ; + 3 ; file to be included + 4 + 5 000002 000001 .word 1 ; to show it is included + 5 + 8 .include \incl.mac\ + 1 ;;;;; + 2 ; + 3 ; file to be included + 4 + 5 000004 000001 .word 1 ; to show it is included + 5 + 9 .include ?incl.mac? + 1 ;;;;; + 2 ; + 3 ; file to be included + 4 + 5 000006 000001 .word 1 ; to show it is included + 5 + 10 .include >incl.mac> + 1 ;;;;; + 2 ; + 3 ; file to be included + 4 + 5 000010 000001 .word 1 ; to show it is included + 5 + 11 + 12 ; these are errors: (in MACRO V05.05, some terminate the assembler) + 13 +test-include.mac:14: ***ERROR Bad .INCLUDE file name + 14 .include +test-include.mac:15: ***ERROR Bad .INCLUDE file name + 15 .include