EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t2408: Pseudoinstruction INCLUDE in a loop


Description
INCLUDE* does not work in %FOR,%REPEAT,%WHILE block because the statement is replaced with included content in first iteration. This can be solved by creating filelist first.
Tested procedures
StmExpandField  
Included file 1 t2408.i.asm
 ALIGN OWORD
 DB "Included file i."
Included file 2 t2408.j.asm
ALIGN OWORD
 DB "Included file j."
Included file 3 t2408.k.asm
ALIGN OWORD
 DB "Included file k."
Source file t2408.asm
 EUROASM LIST=ON,DUMP=ON,DUMPWIDTH=20,DUMPALL=OFF, \
         LISTREPEAT=OFF,LISTVAR=ON,LISTINCLUDE=OFF
t2408  PROGRAM FORMAT=BIN,LISTMAP=OFF,LISTGLOBALS=OFF
[BIN]
  DB "INCLUDE 3 files."
; Whole list of files can be included at once.
letter %FOR i,j,k
         %FileList %SET %FileList,"t2408.%letter.asm"
       %ENDFOR letter
; %FileList is now ,"t2408.i.asm","t2408.j.asm","t2408.k.asm"
   INCLUDE %FileList[2..%&]
;
; Direct INCLUDE in a preprocessing loop is not supported by EuroAssembler.
 ALIGN OWORD
 DB "INCLUDE in loop does not work.  "
letter %FOR i,j,k
         INCLUDE "t2408.%letter.asm" ; W3610 expected.
       %ENDFOR letter
ENDPROGRAM t2408 ;
Expected listing t2408.asm.lst
| | EUROASM LIST=ON,DUMP=ON,DUMPWIDTH=20,DUMPALL=OFF, \ | | LISTREPEAT=OFF,LISTVAR=ON,LISTINCLUDE=OFF | |t2408 PROGRAM FORMAT=BIN,LISTMAP=OFF,LISTGLOBALS=OFF |[BIN] |[BIN] |0000:494E434C5544~| DB "INCLUDE 3 files." |0010: |; Whole list of files can be included at once. |69 |letter %FOR i,j,k |2C2274323430382E~~| %FileList %SET %FileList,"t2408.%letter.asm" |692E61736D22 !%FileList %SET ,"t2408.i.asm" | | %ENDFOR letter |0010: |; %FileList is now ,"t2408.i.asm","t2408.j.asm","t2408.k.asm" |0010: | INCLUDE %FileList[2..%&] |0010: * INCLUDE ".\t2408.i.asm" |0020: * INCLUDE ".\t2408.j.asm" |0030: * INCLUDE ".\t2408.k.asm" |0040: |; |0040: |; Direct INCLUDE in a preprocessing loop is not supported by EuroAssembler. |0040: | ALIGN OWORD |0040:494E434C5544~| DB "INCLUDE in loop does not work. " |69 |letter %FOR i,j,k |0060: | INCLUDE "t2408.%letter.asm" ; W3610 expected. |## W3610 File inclusion in repeating block "letter" is not supported. |0060: * INCLUDE ".\t2408.i.asm" |## W3610 File inclusion in repeating block "letter" is not supported. |## W3610 File inclusion in repeating block "letter" is not supported. |## W3610 File inclusion in repeating block "letter" is not supported. | | %ENDFOR letter | |ENDPROGRAM t2408 ;
Expected messages t2408.out
I0180 Assembling source file "t2408.asm". I0270 Assembling source "t2408". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t2408". "t2408.asm"{3} I0510 Assembling program pass 1. "t2408.asm"{3} W3610 File inclusion in repeating block "letter" is not supported. W3610 File inclusion in repeating block "letter" is not supported. W3610 File inclusion in repeating block "letter" is not supported. W3610 File inclusion in repeating block "letter" is not supported. I0530 Assembling program pass 2 - final. "t2408.asm"{3} W3610 File inclusion in repeating block "letter" is not supported. W3610 File inclusion in repeating block "letter" is not supported. W3610 File inclusion in repeating block "letter" is not supported. W3610 File inclusion in repeating block "letter" is not supported. I0660 16bit TINY BIN file "t2408.bin" created, size=144. "t2408.asm"{19} I0650 Program "t2408" assembled in 2 passes with errorlevel 3. "t2408.asm"{19} I0750 Source "t2408" (25 lines) assembled in 2 passes with errorlevel 3. I0860 Listing file "t2408.asm.lst" created, size=1585. I0990 EuroAssembler terminated with errorlevel 3.
Expected output file t2408. bin
0000: 49 4E 43 4C 55 44 45 20 33 20 66 69 6C 65 73 2E   INCLUDE 3 files.
0010: 49 6E 63 6C 75 64 65 64 20 66 69 6C 65 20 69 2E   Included file i.
0020: 49 6E 63 6C 75 64 65 64 20 66 69 6C 65 20 6A 2E   Included file j.
0030: 49 6E 63 6C 75 64 65 64 20 66 69 6C 65 20 6B 2E   Included file k.
0040: 49 4E 43 4C 55 44 45 20 69 6E 20 6C 6F 6F 70 20   INCLUDE in loop
0050: 64 6F 65 73 20 6E 6F 74 20 77 6F 72 6B 2E 20 20   does not work.
0060: 49 6E 63 6C 75 64 65 64 20 66 69 6C 65 20 69 2E   Included file i.
0070: 49 6E 63 6C 75 64 65 64 20 66 69 6C 65 20 69 2E   Included file i.
0080: 49 6E 63 6C 75 64 65 64 20 66 69 6C 65 20 69 2E   Included file i.

▲Back to the top▲