diff --git a/test/asm/listing/300-scopes-basic.s b/test/asm/listing/300-scopes-basic.s new file mode 100644 index 000000000..4d97ba431 --- /dev/null +++ b/test/asm/listing/300-scopes-basic.s @@ -0,0 +1,16 @@ + + .org $800 + + symbol1 := * ; ::symbol1 + .addr symbol1 ; ::symbol1 + + +.scope scope1 + symbol1 := * ; ::scope1::symbol1 + + .addr symbol1 ; ::scope1::symbol1 + .addr ::symbol1 ; ::symbol1 +.endscope + + .addr symbol1 ; ::symbol1 + .addr scope1::symbol1 ; ::scope1::symbol diff --git a/test/asm/listing/301-nested-scopes.s b/test/asm/listing/301-nested-scopes.s new file mode 100644 index 000000000..ef70c03ef --- /dev/null +++ b/test/asm/listing/301-nested-scopes.s @@ -0,0 +1,7 @@ + .scope outer + foo = 2 + .scope inner + lda #foo + foo = 3 + .endscope + .endscope diff --git a/test/asm/listing/302-scope-redefined.s b/test/asm/listing/302-scope-redefined.s new file mode 100644 index 000000000..cc2463caf --- /dev/null +++ b/test/asm/listing/302-scope-redefined.s @@ -0,0 +1,7 @@ + .scope outer + foo = $1234 + .scope inner + lda foo,x + foo = $12 + .endscope + .endscope diff --git a/test/asm/listing/303-change-addressing-mode-error.s b/test/asm/listing/303-change-addressing-mode-error.s new file mode 100644 index 000000000..a005581e3 --- /dev/null +++ b/test/asm/listing/303-change-addressing-mode-error.s @@ -0,0 +1,7 @@ + .scope outer + foo = $12 + .scope inner + lda foo,x + foo = $1234 + .endscope + .endscope diff --git a/test/asm/listing/304-fix-addressing-mode-error.s b/test/asm/listing/304-fix-addressing-mode-error.s new file mode 100644 index 000000000..3dda1d8ee --- /dev/null +++ b/test/asm/listing/304-fix-addressing-mode-error.s @@ -0,0 +1,7 @@ + .scope outer + foo = $12 + .scope inner + lda a:foo,x + foo = $1234 + .endscope + .endscope diff --git a/test/asm/listing/305-explicit-scope-reference.s b/test/asm/listing/305-explicit-scope-reference.s new file mode 100644 index 000000000..b3423ab25 --- /dev/null +++ b/test/asm/listing/305-explicit-scope-reference.s @@ -0,0 +1,6 @@ + bar = 3 + + .scope foo + bar = 2 + lda #::bar ; Access the global bar (which is 3) + .endscope diff --git a/test/asm/listing/306-scope-use-before-definition.s b/test/asm/listing/306-scope-use-before-definition.s new file mode 100644 index 000000000..8a0f37f24 --- /dev/null +++ b/test/asm/listing/306-scope-use-before-definition.s @@ -0,0 +1,10 @@ + .scope foo + bar = 3 + .endscope + + .scope outer + lda #foo::bar ; Will load 3, not 2! + .scope foo + bar = 2 + .endscope + .endscope diff --git a/test/asm/listing/307-scope-chains.s b/test/asm/listing/307-scope-chains.s new file mode 100644 index 000000000..860589244 --- /dev/null +++ b/test/asm/listing/307-scope-chains.s @@ -0,0 +1,18 @@ + .scope foo + .scope outer + .scope inner + bar = 1 + .endscope + .endscope + .scope another + .scope nested + lda #outer::inner::bar ; 1 + .endscope + .endscope + .endscope + + .scope outer + .scope inner + bar = 2 + .endscope + .endscope diff --git a/test/asm/listing/308-global-scope-anchoring.s b/test/asm/listing/308-global-scope-anchoring.s new file mode 100644 index 000000000..65df8b1fc --- /dev/null +++ b/test/asm/listing/308-global-scope-anchoring.s @@ -0,0 +1,18 @@ + .scope foo + .scope outer + .scope inner + bar = 1 + .endscope + .endscope + .scope another + .scope nested + lda #::outer::inner::bar ; 2 + .endscope + .endscope + .endscope + + .scope outer + .scope inner + bar = 2 + .endscope + .endscope diff --git a/test/asm/listing/309-namespace-path-vs-addressing-mode.s b/test/asm/listing/309-namespace-path-vs-addressing-mode.s new file mode 100644 index 000000000..fae9b9bd4 --- /dev/null +++ b/test/asm/listing/309-namespace-path-vs-addressing-mode.s @@ -0,0 +1,16 @@ +.org $2000 + +.proc s1 + + symbol := $1 + + stx s1::s2::symbol + stx s2_symbol + +.scope s2 +symbol: .byte 0 +.endscope + +s2_symbol := s2::symbol + +.endproc diff --git a/test/asm/listing/310-create-in-current-scope.s b/test/asm/listing/310-create-in-current-scope.s new file mode 100644 index 000000000..422756f9c --- /dev/null +++ b/test/asm/listing/310-create-in-current-scope.s @@ -0,0 +1,15 @@ +.scope main +.proc foo + + ;; should all be the same + lda params__bar + lda params::bar + lda foo::params::bar + +.proc params +bar: .byte 0 +.endproc + params__bar := params::bar + +.endproc +.endscope diff --git a/test/asm/listing/311-close-new-scopes-error.s b/test/asm/listing/311-close-new-scopes-error.s new file mode 100644 index 000000000..72346b25a --- /dev/null +++ b/test/asm/listing/311-close-new-scopes-error.s @@ -0,0 +1,9 @@ +.scope foo +start: + jmp bar::start +.endscope + +.scope bar +start: + rts +.endscope diff --git a/test/asm/listing/control/303-change-addressing-mode-error.err b/test/asm/listing/control/303-change-addressing-mode-error.err new file mode 100644 index 000000000..e69de29bb diff --git a/test/asm/listing/control/311-close-new-scopes-error.err b/test/asm/listing/control/311-close-new-scopes-error.err new file mode 100644 index 000000000..e69de29bb diff --git a/test/asm/listing/ref/300-scopes-basic.bin-ref b/test/asm/listing/ref/300-scopes-basic.bin-ref new file mode 100644 index 000000000..a5f97a8a8 Binary files /dev/null and b/test/asm/listing/ref/300-scopes-basic.bin-ref differ diff --git a/test/asm/listing/ref/300-scopes-basic.list-ref b/test/asm/listing/ref/300-scopes-basic.list-ref new file mode 100644 index 000000000..bf7649c96 --- /dev/null +++ b/test/asm/listing/ref/300-scopes-basic.list-ref @@ -0,0 +1,21 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 300-scopes-basic.s +Current file: 300-scopes-basic.s + +000000r 1 +000000r 1 .org $800 +000800 1 +000800 1 symbol1 := * ; ::symbol1 +000800 1 00 08 .addr symbol1 ; ::symbol1 +000802 1 +000802 1 +000802 1 .scope scope1 +000802 1 symbol1 := * ; ::scope1::symbol1 +000802 1 +000802 1 02 08 .addr symbol1 ; ::scope1::symbol1 +000804 1 00 08 .addr ::symbol1 ; ::symbol1 +000806 1 .endscope +000806 1 +000806 1 00 08 .addr symbol1 ; ::symbol1 +000808 1 02 08 .addr scope1::symbol1 ; ::scope1::symbol +000808 1 diff --git a/test/asm/listing/ref/301-nested-scopes.bin-ref b/test/asm/listing/ref/301-nested-scopes.bin-ref new file mode 100644 index 000000000..0b3310a2e --- /dev/null +++ b/test/asm/listing/ref/301-nested-scopes.bin-ref @@ -0,0 +1 @@ +© \ No newline at end of file diff --git a/test/asm/listing/ref/301-nested-scopes.list-ref b/test/asm/listing/ref/301-nested-scopes.list-ref new file mode 100644 index 000000000..64d2f6500 --- /dev/null +++ b/test/asm/listing/ref/301-nested-scopes.list-ref @@ -0,0 +1,12 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 301-nested-scopes.s +Current file: 301-nested-scopes.s + +000000r 1 .scope outer +000000r 1 foo = 2 +000000r 1 .scope inner +000000r 1 A9 03 lda #foo +000002r 1 foo = 3 +000002r 1 .endscope +000002r 1 .endscope +000002r 1 diff --git a/test/asm/listing/ref/302-scope-redefined.bin-ref b/test/asm/listing/ref/302-scope-redefined.bin-ref new file mode 100644 index 000000000..4a028ecca Binary files /dev/null and b/test/asm/listing/ref/302-scope-redefined.bin-ref differ diff --git a/test/asm/listing/ref/302-scope-redefined.list-ref b/test/asm/listing/ref/302-scope-redefined.list-ref new file mode 100644 index 000000000..624fac152 --- /dev/null +++ b/test/asm/listing/ref/302-scope-redefined.list-ref @@ -0,0 +1,12 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 302-scope-redefined.s +Current file: 302-scope-redefined.s + +000000r 1 .scope outer +000000r 1 foo = $1234 +000000r 1 .scope inner +000000r 1 BD 12 00 lda foo,x +000003r 1 foo = $12 +000003r 1 .endscope +000003r 1 .endscope +000003r 1 diff --git a/test/asm/listing/ref/302-scope-redefined.list-ref-bak b/test/asm/listing/ref/302-scope-redefined.list-ref-bak new file mode 100644 index 000000000..468c08409 --- /dev/null +++ b/test/asm/listing/ref/302-scope-redefined.list-ref-bak @@ -0,0 +1,12 @@ +ca65 V2.19 - Git 7f1dd09bc +Main file : 302-scope-redefined.s +Current file: 302-scope-redefined.s + +000000r 1 .scope outer +000000r 1 foo = $1234 +000000r 1 .scope inner +000000r 1 BD 12 00 lda foo,x +000003r 1 foo = $12 +000003r 1 .endscope +000003r 1 .endscope +000003r 1 diff --git a/test/asm/listing/ref/303-change-addressing-mode-error.err2-ref b/test/asm/listing/ref/303-change-addressing-mode-error.err2-ref new file mode 100644 index 000000000..fbbbe831b --- /dev/null +++ b/test/asm/listing/ref/303-change-addressing-mode-error.err2-ref @@ -0,0 +1 @@ +303-change-addressing-mode-error.s:4: Error: Range error (4660 not in [0..255]) diff --git a/test/asm/listing/ref/304-fix-addressing-mode-error.bin-ref b/test/asm/listing/ref/304-fix-addressing-mode-error.bin-ref new file mode 100644 index 000000000..57089a9e1 --- /dev/null +++ b/test/asm/listing/ref/304-fix-addressing-mode-error.bin-ref @@ -0,0 +1 @@ +½4 \ No newline at end of file diff --git a/test/asm/listing/ref/304-fix-addressing-mode-error.list-ref b/test/asm/listing/ref/304-fix-addressing-mode-error.list-ref new file mode 100644 index 000000000..2d208331f --- /dev/null +++ b/test/asm/listing/ref/304-fix-addressing-mode-error.list-ref @@ -0,0 +1,12 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 304-fix-addressing-mode-error.s +Current file: 304-fix-addressing-mode-error.s + +000000r 1 .scope outer +000000r 1 foo = $12 +000000r 1 .scope inner +000000r 1 BD 34 12 lda a:foo,x +000003r 1 foo = $1234 +000003r 1 .endscope +000003r 1 .endscope +000003r 1 diff --git a/test/asm/listing/ref/305-explicit-scope-reference.bin-ref b/test/asm/listing/ref/305-explicit-scope-reference.bin-ref new file mode 100644 index 000000000..0b3310a2e --- /dev/null +++ b/test/asm/listing/ref/305-explicit-scope-reference.bin-ref @@ -0,0 +1 @@ +© \ No newline at end of file diff --git a/test/asm/listing/ref/305-explicit-scope-reference.list-ref b/test/asm/listing/ref/305-explicit-scope-reference.list-ref new file mode 100644 index 000000000..14953529c --- /dev/null +++ b/test/asm/listing/ref/305-explicit-scope-reference.list-ref @@ -0,0 +1,11 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 305-explicit-scope-reference.s +Current file: 305-explicit-scope-reference.s + +000000r 1 bar = 3 +000000r 1 +000000r 1 .scope foo +000000r 1 bar = 2 +000000r 1 A9 03 lda #::bar ; Access the global bar (which is 3) +000002r 1 .endscope +000002r 1 diff --git a/test/asm/listing/ref/306-scope-use-before-definition.bin-ref b/test/asm/listing/ref/306-scope-use-before-definition.bin-ref new file mode 100644 index 000000000..0b3310a2e --- /dev/null +++ b/test/asm/listing/ref/306-scope-use-before-definition.bin-ref @@ -0,0 +1 @@ +© \ No newline at end of file diff --git a/test/asm/listing/ref/306-scope-use-before-definition.list-ref b/test/asm/listing/ref/306-scope-use-before-definition.list-ref new file mode 100644 index 000000000..9bdb31659 --- /dev/null +++ b/test/asm/listing/ref/306-scope-use-before-definition.list-ref @@ -0,0 +1,15 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 306-scope-use-before-definition.s +Current file: 306-scope-use-before-definition.s + +000000r 1 .scope foo +000000r 1 bar = 3 +000000r 1 .endscope +000000r 1 +000000r 1 .scope outer +000000r 1 A9 03 lda #foo::bar ; Will load 3, not 2! +000002r 1 .scope foo +000002r 1 bar = 2 +000002r 1 .endscope +000002r 1 .endscope +000002r 1 diff --git a/test/asm/listing/ref/307-scope-chains.bin-ref b/test/asm/listing/ref/307-scope-chains.bin-ref new file mode 100644 index 000000000..7cd3c6693 --- /dev/null +++ b/test/asm/listing/ref/307-scope-chains.bin-ref @@ -0,0 +1 @@ +© \ No newline at end of file diff --git a/test/asm/listing/ref/307-scope-chains.list-ref b/test/asm/listing/ref/307-scope-chains.list-ref new file mode 100644 index 000000000..2904384b0 --- /dev/null +++ b/test/asm/listing/ref/307-scope-chains.list-ref @@ -0,0 +1,23 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 307-scope-chains.s +Current file: 307-scope-chains.s + +000000r 1 .scope foo +000000r 1 .scope outer +000000r 1 .scope inner +000000r 1 bar = 1 +000000r 1 .endscope +000000r 1 .endscope +000000r 1 .scope another +000000r 1 .scope nested +000000r 1 A9 01 lda #outer::inner::bar ; 1 +000002r 1 .endscope +000002r 1 .endscope +000002r 1 .endscope +000002r 1 +000002r 1 .scope outer +000002r 1 .scope inner +000002r 1 bar = 2 +000002r 1 .endscope +000002r 1 .endscope +000002r 1 diff --git a/test/asm/listing/ref/308-global-scope-anchoring.bin-ref b/test/asm/listing/ref/308-global-scope-anchoring.bin-ref new file mode 100644 index 000000000..f0eb53ecc --- /dev/null +++ b/test/asm/listing/ref/308-global-scope-anchoring.bin-ref @@ -0,0 +1 @@ +© \ No newline at end of file diff --git a/test/asm/listing/ref/308-global-scope-anchoring.list-ref b/test/asm/listing/ref/308-global-scope-anchoring.list-ref new file mode 100644 index 000000000..7983d6894 --- /dev/null +++ b/test/asm/listing/ref/308-global-scope-anchoring.list-ref @@ -0,0 +1,23 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 308-global-scope-anchoring.s +Current file: 308-global-scope-anchoring.s + +000000r 1 .scope foo +000000r 1 .scope outer +000000r 1 .scope inner +000000r 1 bar = 1 +000000r 1 .endscope +000000r 1 .endscope +000000r 1 .scope another +000000r 1 .scope nested +000000r 1 A9 02 lda #::outer::inner::bar ; 2 +000002r 1 .endscope +000002r 1 .endscope +000002r 1 .endscope +000002r 1 +000002r 1 .scope outer +000002r 1 .scope inner +000002r 1 bar = 2 +000002r 1 .endscope +000002r 1 .endscope +000002r 1 diff --git a/test/asm/listing/ref/309-namespace-path-vs-addressing-mode.bin-ref b/test/asm/listing/ref/309-namespace-path-vs-addressing-mode.bin-ref new file mode 100644 index 000000000..e712b68e4 Binary files /dev/null and b/test/asm/listing/ref/309-namespace-path-vs-addressing-mode.bin-ref differ diff --git a/test/asm/listing/ref/309-namespace-path-vs-addressing-mode.list-ref b/test/asm/listing/ref/309-namespace-path-vs-addressing-mode.list-ref new file mode 100644 index 000000000..0bbc19268 --- /dev/null +++ b/test/asm/listing/ref/309-namespace-path-vs-addressing-mode.list-ref @@ -0,0 +1,21 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 309-namespace-path-vs-addressing-mode.s +Current file: 309-namespace-path-vs-addressing-mode.s + +000000r 1 .org $2000 +002000 1 +002000 1 .proc s1 +002000 1 +002000 1 symbol := $1 +002000 1 +002000 1 8E 06 20 stx s1::s2::symbol +002003 1 8E 06 20 stx s2_symbol +002006 1 +002006 1 .scope s2 +002006 1 00 symbol: .byte 0 +002007 1 .endscope +002007 1 +002007 1 s2_symbol := s2::symbol +002007 1 +002007 1 .endproc +002007 1 diff --git a/test/asm/listing/ref/310-create-in-current-scope.bin-ref b/test/asm/listing/ref/310-create-in-current-scope.bin-ref new file mode 100644 index 000000000..4a483cae1 Binary files /dev/null and b/test/asm/listing/ref/310-create-in-current-scope.bin-ref differ diff --git a/test/asm/listing/ref/310-create-in-current-scope.list-ref b/test/asm/listing/ref/310-create-in-current-scope.list-ref new file mode 100644 index 000000000..ba2de6d4a --- /dev/null +++ b/test/asm/listing/ref/310-create-in-current-scope.list-ref @@ -0,0 +1,20 @@ +ca65 Vx.xx - Git XXXXXXXXX +Main file : 310-create-in-current-scope.s +Current file: 310-create-in-current-scope.s + +000000r 1 .scope main +000000r 1 .proc foo +000000r 1 +000000r 1 ;; should all be the same +000000r 1 AD rr rr lda params__bar +000003r 1 AD rr rr lda params::bar +000006r 1 AD rr rr lda foo::params::bar +000009r 1 +000009r 1 .proc params +000009r 1 00 bar: .byte 0 +00000Ar 1 .endproc +00000Ar 1 params__bar := params::bar +00000Ar 1 +00000Ar 1 .endproc +00000Ar 1 .endscope +00000Ar 1 diff --git a/test/asm/listing/ref/311-close-new-scopes-error.err2-ref b/test/asm/listing/ref/311-close-new-scopes-error.err2-ref new file mode 100644 index 000000000..ee60a497e --- /dev/null +++ b/test/asm/listing/ref/311-close-new-scopes-error.err2-ref @@ -0,0 +1 @@ +311-close-new-scopes-error.s:3: Error: Symbol 'start' is undefined