EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t8347: Assigning user %variables which collide with formal %variables


See also
t8349  
Tested procedures
VarCheckFormal   VarCheckId  
Source file t8347.asm
      EUROASM DUMP=ON, DUMPALL=YES, DUMPWIDTH=32, \
              LIST=ON, LISTVAR=NO, LISTMACRO=YES
t8347 PROGRAM FORMAT=BIN, LISTMAP=OFF, LISTGLOBALS=OFF

%Var11 %SET 0x11 ; Assign user %variable outside the macro.

Sample %MACRO Var11,Var22,Var33=0x33,Var44=0x44 ; Declare a macro.
 %Var22 %SET 0x02 ; Assign user %variables with colliding names. W2510 expected.
 %Var33 %SET 0x03
 %Var44 %SET 0x04
  DB %Var11       ; Expand the 1st formal operand  with provided value 0x55.
  DB %Var22       ; Expand the 2nd formal operand  with provided value 0x66,
  DB %Var33       ; Expand the 1st keyword operand with provided value 0x77.
  DB %Var44       ; Expand the 2nd keyword operand with default value  0x44.
%ENDMACRO Sample

  Sample 0x55,0x66,Var33=0x77 ; Provide operands and expand the macro.

  DB %Var11       ; Define byte with value 0x11 assigned outside the macro.
  DB %Var22       ; Define byte with value 0x02 assigned inside the macro.
  DB %Var33       ; Define byte with value 0x03 assigned inside the macro.
  DB %Var44       ; Define byte with value 0x04 assigned inside the macro.
ENDPROGRAM t8347
Expected listing t8347.asm.lst
| | EUROASM DUMP=ON, DUMPALL=YES, DUMPWIDTH=32, \ | | LIST=ON, LISTVAR=NO, LISTMACRO=YES | |t8347 PROGRAM FORMAT=BIN, LISTMAP=OFF, LISTGLOBALS=OFF |[BIN] ::::Section changed. |0000: | |30783131 |%Var11 %SET 0x11 ; Assign user %variable outside the macro. |0000: | | |Sample %MACRO Var11,Var22,Var33=0x33,Var44=0x44 ; Declare a macro. | | %Var22 %SET 0x02 ; Assign user %variables with colliding names. W2510 expected. | | %Var33 %SET 0x03 | | %Var44 %SET 0x04 | | DB %Var11 ; Expand the 1st formal operand with provided value 0x55. | | DB %Var22 ; Expand the 2nd formal operand with provided value 0x66, | | DB %Var33 ; Expand the 1st keyword operand with provided value 0x77. | | DB %Var44 ; Expand the 2nd keyword operand with default value 0x44. | |%ENDMACRO Sample |0000: | |0000: | Sample 0x55,0x66,Var33=0x77 ; Provide operands and expand the macro. | +Sample %MACRO Var11,Var22,Var33=0x33,Var44=0x44 ; Declare a macro. |30783032 + %Var22 %SET 0x02 ; Assign user %variables with colliding names. W2510 expected. |## W2510 Formal variable "%Var22" will not be overwritten. |30783033 + %Var33 %SET 0x03 |## W2510 Formal variable "%Var33" will not be overwritten. |30783034 + %Var44 %SET 0x04 |## W2510 Formal variable "%Var44" will not be overwritten. |0000:55 + DB %Var11 ; Expand the 1st formal operand with provided value 0x55. |0001:66 + DB %Var22 ; Expand the 2nd formal operand with provided value 0x66, |0002:77 + DB %Var33 ; Expand the 1st keyword operand with provided value 0x77. |0003:44 + DB %Var44 ; Expand the 2nd keyword operand with default value 0x44. | +%ENDMACRO Sample |0004: | |0004:11 | DB %Var11 ; Define byte with value 0x11 assigned outside the macro. |0005:02 | DB %Var22 ; Define byte with value 0x02 assigned inside the macro. |0006:03 | DB %Var33 ; Define byte with value 0x03 assigned inside the macro. |0007:04 | DB %Var44 ; Define byte with value 0x04 assigned inside the macro. | |ENDPROGRAM t8347
Expected messages t8347.out
I0180 Assembling source file "t8347.asm". I0270 Assembling source "t8347". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8347". "t8347.asm"{3} I0510 Assembling program pass 1. "t8347.asm"{3} W2510 Formal variable "%Var22" will not be overwritten. "t8347.asm"{8} "t8347.asm"{17} W2510 Formal variable "%Var33" will not be overwritten. "t8347.asm"{9} "t8347.asm"{17} W2510 Formal variable "%Var44" will not be overwritten. "t8347.asm"{10} "t8347.asm"{17} I0530 Assembling program pass 2 - final. "t8347.asm"{3} W2510 Formal variable "%Var22" will not be overwritten. "t8347.asm"{8} "t8347.asm"{17} W2510 Formal variable "%Var33" will not be overwritten. "t8347.asm"{9} "t8347.asm"{17} W2510 Formal variable "%Var44" will not be overwritten. "t8347.asm"{10} "t8347.asm"{17} I0660 16bit TINY BIN file "t8347.bin" created, size=8. "t8347.asm"{23} I0650 Program "t8347" assembled in 2 passes with errorlevel 2. "t8347.asm"{23} I0750 Source "t8347" (23 lines) assembled in 2 passes with errorlevel 2. I0860 Listing file "t8347.asm.lst" created, size=2919. I0990 EuroAssembler terminated with errorlevel 2.

▲Back to the top▲