| Index | Manual | Download | Source | Macros | Embedded word Case ins.
Sitemap | Links | Forum | Tests | Projects

# Test t2641: Pseudoinstruction %FOR overlaping formal %variable.

Description
  Preservation of user-defined %variable after %FOR loop with formal variable which happens to have the same name. Default and explicit %FOR SETP= value.
See also
  t5742
Tested procedures
  PseudopcFOR PseudopcENDFOR CtxForNext

Source & expected listing t2641.htm.lst
  `| | EUROASM LIST=ON, DUMP=ON, DUMPWIDTH=40, LISTREPEAT=OFF | |t2641 PROGRAM FORMAT=BIN, MAXEXPANSIONS=99, LISTMAP=OFF, LISTGLOBALS=OFF, IMAGEBASE=0 |[BIN] |[BIN] SEGMENT WIDTH=16, PURPOSE=DATA |22557365722D646566696E65642073747222 |%Formal %SET "User-defined str" |0000:557365722D646566696E656420737472 | DB %Formal ; User-defined %variable. |30 |Formal %FOR 0..7, 15..8, '0'..'7', 'h'..'a' ; Default step. |0010:00 | DB %Formal ; Actual emitting statement expands formal %variable. | | %ENDFOR Formal |2D3634 |Formal %FOR -40h..+38h, 38h..-40h, STEP=+8h |0030:C0 | DB %Formal ; Actual emitting statement expands formal %variable. | | %ENDFOR Formal |3536 |Formal %FOR -40h..+38h, 38h..-40h, STEP=-8h |0040:38 | DB %Formal ; Actual emitting statement expands formal %variable. | | %ENDFOR Formal |0050:557365722D646566696E656420737472 | DB %Formal ; User-defined %variable again. | | ENDPROGRAM t2641`

Expected messages t2641.out
  `I0180 Assembling source file "t2641.htm". I0270 Assembling source "t2641". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t2641". "t2641.htm"{64} I0510 Assembling program pass 1. "t2641.htm"{64} I0530 Assembling program pass 2 - final. "t2641.htm"{64} I0660 16bit TINY BIN file "t2641.bin" created, size=96. "t2641.htm"{78} I0650 Program "t2641" assembled in 2 passes with errorlevel 0. "t2641.htm"{78} I0750 Source "t2641" (106 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t2641.htm.lst" created, size=1426. I0990 EuroAssembler terminated with errorlevel 0.`

Expected output file t2641. bin

      0000: 55 73 65 72 2D 64 65 66 69 6E 65 64 20 73 74 72  User-defined¯str
      0010: 00 01 02 03 04 05 06 07 0F 0E 0D 0C 0B 0A 09 08  °············¬··
      0020: 30 31 32 33 34 35 36 37 68 67 66 65 64 63 62 61  01234567hgfedcba
      0030: C0 C8 D0 D8 E0 E8 F0 F8 00 08 10 18 20 28 30 38  ¤¤¤¤¤¤¤¤°···¯(08
      0040: 38 30 28 20 18 10 08 00 F8 F0 E8 E0 D8 D0 C8 C0  80(¯···°¤¤¤¤¤¤¤¤
      0050: 55 73 65 72 2D 64 65 66 69 6E 65 64 20 73 74 72  User-defined¯str

▲Back to the top▲