EUROASM DUMP=ON, DUMPALL=YES, DUMPWIDTH=32, \
LIST=ON, LISTVAR=NO, LISTMACRO=YES
t8349 PROGRAM FORMAT=BIN, LISTMAP=OFF, LISTGLOBALS=OFF
; Assign user %variables outside macros.
%Ext1 %SET 0x11 ; Assign user value 0x11.
%Ext2 %SET 0x22 ; Assign user value 0x22.
%Ext3 %SET 0x33 ; Assign user value 0x33.
; Declare macro Inner, which will be invoked later from Outer with
; arguments 0xDD, 0xBB, 0x88.
Inner %MACRO Inn1, Inn2, Inn3
; Assign three user %variables inside the macro Inner.
%Ext1 %SET 0x44 ; Reassign user value from 0x11 to 0x44.
%Inn2 %SET 0x55 ; W2510 expected. Formal %Inn2 keeps its previous value 0xBB.
%Out3 %SET 0x66 ; W2510 expected. Formal parent's %Out3 keeps its previous value 0xCC.
DB %Ext1 ; Reassigned (by Inner) user value 0x44 expected.
DB %Ext2 ; Reassigned (by Outer) user value 0x77 expected.
DB %Ext3 ; Assigned user value 0x33 expected.
DB %Out1 ; Formal Outer value 0xAA expected.
DB %Out2 ; Formal Outer value 0xBB expected.
DB %Out3 ; Formal Outer value 0xCC expected.
DB %Inn1 ; Formal Inner value 0xDD expected.
DB %Inn2 ; Formal Inner value 0xBB expected.
DB %Inn3 ; Formal Inner value 0x88 expected.
%ENDMACRO Inner
; Declare macro Outer, which will be invoked later in program with
; arguments 0xAA, 0xBB, 0xCC.
Outer %MACRO Out1, Out2, Out3
; Assign three user %variables inside the macro Inner.
%Ext2 %SET 0x77 ; Reassigning from 0x22 to 0x77.
%Inn3 %SET 0x88 ; Assign user value 0x88.
%Out1 %SET 0x99 ; W2510 expected. Formal %Out1 keeps its previous value 0xAA.
DB %Ext1 ; Assigned user value 0x11 expected.
DB %Ext2 ; Reassigned (by Outer) user value 0x77 expected.
DB %Ext3 ; Assigned user value 0x33 expected.
DB %Out1 ; Formal value 0xAA expected.
DB %Out2 ; Formal value 0xBB expected.
DB %Out3 ; Formal value 0xCC expected.
DB %Inn1 ; Unassigned value expected.
DB %Inn2 ; Unassigned value expected.
DB %Inn3 ; Assigned (by Outer) user value 0x88 expected.
Inner 0xDD, %Out2, %Inn3 ; Macro Inner invoked with 0xDD,0xBB,0x88.
DB %Inn1 ; Unassigned value expected.
DB %Inn2 ; Assigned (by Inner) user value 0x55 expected.
DB %Inn3 ; Assigned (by Outer) user value 0x88 expected.
%ENDMACRO Outer
; Demonstrate values of all %variables before macro invocation.
DB %Ext1 ; Assigned user value 0x11 expected.
DB %Ext2 ; Assigned user value 0x22 expected.
DB %Ext3 ; Assigned user value 0x33 expected.
DB %Out1 ; Unassigned value expected.
DB %Out2 ; Unassigned value expected.
DB %Out3 ; Unassigned value expected.
DB %Inn1 ; Unassigned value expected.
DB %Inn2 ; Unassigned value expected.
DB %Inn3 ; Unassigned value expected.
Outer 0xAA, 0xBB, 0xCC ; invocation of macro Outer.
; Demonstrate values of all %variables after Outer expansion.
DB %Ext1 ; Reassigned (by Inner) value 0x44 expected.
DB %Ext2 ; Reassigned (by Outer) value 0x77 expected.
DB %Ext3 ; Assigned user value 0x33 expected.
DB %Out1 ; Assigned (by Outer) user value 0x99 expected.
DB %Out2 ; Unassigned value expected.
DB %Out3 ; Assigned (by Inner) user value 0x66 expected.
DB %Inn1 ; Unassigned value expected.
DB %Inn2 ; Assigned (by Inner) user value 0x55 expected.
DB %Inn3 ; Assigned (by Outer) user value 0x88 expected.
ENDPROGRAM t8349