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

# Test t2642: Pseudoinstruction %FOR nested

Description
  Block identifiers used with repeating pseudoinstructions help to keep proper block nesting, and if used with %EXITblock, it allows to select which loop to prematurely break.
Tested procedures
  PseudopcFOR PseudopcENDFOR PseudopcEXITFOR

Source & expected listing t2642.htm.lst
  `| | EUROASM LIST=ON, DUMP=ON, DUMPWIDTH=16, LISTREPEAT=OFF | |t2642 PROGRAM FORMAT=BIN, MAXEXPANSIONS=999, LISTMAP=OFF, LISTGLOBALS=OFF, IMAGEBASE=0 |[BIN] |[BIN] SEGMENT WIDTH=16, PURPOSE=DATA |3136 |Outer %FOR 0x10..0xF0, STEP=0x10 |31 |Inner %FOR 0x01..0x0F, STEP=0x01 |FALSE | %IF %Inner > 0x04 | | %EXITFOR Inner ; Premature break of inner block. | | %ENDIF |0000:11 | DB %Outer + %Inner ; Actual emitting statement. | | %ENDFOR Inner | | %ENDFOR Outer |003C:00000000 | ALIGN OWORD |0040: |; Assemble the double loop again, this time prematurely breaking the outer loop: |3136 |Outer %FOR 0x10..0xF0, STEP=0x10 |31 |Inner %FOR 0x01..0x0F, STEP=0x01 |FALSE | %IF %Inner > 0x04 | | %EXITFOR Outer ; Premature break of outer block. | | %ENDIF |0040:11 | DB %Outer + %Inner ; Actual emitting statement. | | %ENDFOR Inner | | %ENDFOR Outer | | ENDPROGRAM t2642`

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

Expected output file t2642. bin

      0000: 11 12 13 14 21 22 23 24 31 32 33 34 41 42 43 44  ····!"#$1234ABCD
      0010: 51 52 53 54 61 62 63 64 71 72 73 74 81 82 83 84  QRSTabcdqrst¤¤¤¤
      0020: 91 92 93 94 A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4  ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
      0030: D1 D2 D3 D4 E1 E2 E3 E4 F1 F2 F3 F4 00 00 00 00  ¤¤¤¤¤¤¤¤¤¤¤¤°°°°
      0040: 11 12 13 14                                      ····

▲Back to the top▲