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

# Test t2752: Pseudoinstruction %REPEAT 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
  PseudopcREPEAT PseudopcEXITREPEAT PseudopcENDREPEAT

Source & expected listing t2752.htm.lst
  `| | EUROASM LIST=ON, DUMP=ON, DUMPWIDTH=16, LISTREPEAT=OFF | |t2752 PROGRAM FORMAT=BIN,MODEL=TINY,WIDTH=16,MAXEXPANSIONS=99,LISTMAP=OFF,LISTGLOBALS=OFF,IMAGEBASE=0 |[BIN] |[BIN] SEGMENT WIDTH=16, PURPOSE=DATA |313630 |%O %SETA 0xA0 ; Initialization of outer block control %variable. | | %REPEAT Outer |31 |%I %SETA 0x01 ; Initialization of inner block control %variable. | | %REPEAT Inner |FALSE | %IF %I > 0x04 | | %EXITREPEAT Inner ; Premature break of inner block. | | %ENDIF |0000:A1 | DB %O + %I ; Actual emitting statement. |32 | %I %SETA %I + 0x01 ; Modification of inner block control %variable. | |Inner %UNTIL %I > 0x09 |313736 | %O %SETA %O + 0x10 ; Modification of outer block control %variable. |TRUE |Outer %UNTIL %O >0xF0 |0018:00000000~| ALIGN OWORD |0020: |; Assemble the double loop again, this time prematurely breaking the outer loop: |313630 |%O %SETA 0xA0 ; Initialization of outer block control %variable. | | %REPEAT Outer |31 |%I %SETA 0x01 ; Initialization of inner block control %variable. | | %REPEAT Inner |FALSE | %IF %I > 0x04 | | %EXITREPEAT Outer ; Premature break of outer block. | | %ENDIF |0020:A1 | DB %O + %I ; Actual emitting statement. |32 | %I %SETA %I + 0x01 ; Modification of inner block control %variable. | |Inner %UNTIL %I > 0x09 | | %O %SETA %O + 0x10 ; Modification of outer block control %variable. | |Outer %UNTIL %O >0xF0 | | ENDPROGRAM t2752`

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

Expected output file t2752. bin

      0000: A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4 D1 D2 D3 D4  ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
      0010: E1 E2 E3 E4 F1 F2 F3 F4 00 00 00 00 00 00 00 00  ¤¤¤¤¤¤¤¤°°°°°°°°
      0020: A1 A2 A3 A4                                      ¤¤¤¤

▲Back to the top▲