EuroAssembler Index Manual Download Source Macros

Sitemap Links Forum Tests Projects

Test t2501: Pseudoinstruction STRUC forward referrenced

Although it is a good custom to declare all data structures near the beginning of a program, it is not necessary in EuroAssembler. A structure may be declared after it has been used in a data expression. It may require an additional program pass, however.
See also
Tested procedures
PseudoSTRUC   PseudoENDSTRUC   PseudoData  
Source & expected listing t2501.htm.lst
| | EUROASM LIST=ON, DUMP=ON, DUMPWIDTH=16, AUTOALIGN=OFF, NOWARN=2101..2102 | |t2501 PROGRAM FORMAT=BIN,MODEL=TINY,WIDTH=16,LISTMAP=OFF,LISTGLOBALS=OFF |[BIN] |[BIN] SEGMENT WIDTH=16, PURPOSE=DATA |[S1] |S1 STRUC ; Declaration of a structure. |0000:1A | .A DB 0x1A |0001:1B | .B DB 0x1B |0002:1C | .C DB 0x1C |0003: | ENDSTRUC S1 |[BIN] ::::Section changed. |0000:11 | DB 0x11 ; Data marker. |0001:1A1B1C |D1 D S1 ; Instance of backward referrenced structure. |0004:22 | DB 0x22 ; Data marker. |0005:2A2B2C |D2 D S2 ; Instance of forward referrenced structure. |0008:33 | DB 0x33 ; Data marker. |[S2] |S2 STRUC ; Declaration of a structure, which was already mentioned. |0000:2A | .A DB 0x2A |0001:2B | .B DB 0x2B |0002:2C | .C DB 0x2C |0003: | ENDSTRUC S2 |[BIN] ::::Section changed. |0009:44 | DB 0x44 ; Data marker. | | ENDPROGRAM t2501
Expected messages t2501.out
I0180 Assembling source file "t2501.htm". I0270 Assembling source "t2501". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t2501". "t2501.htm"{64} I0510 Assembling program pass 1. "t2501.htm"{64} I0510 Assembling program pass 2. "t2501.htm"{64} I0510 Assembling program pass 3. "t2501.htm"{64} I0530 Assembling program pass 4 - final. "t2501.htm"{64} I0660 16bit TINY BIN file "t2501.bin" created, size=10. "t2501.htm"{84} I0650 Program "t2501" assembled in 4 passes with errorlevel 0. "t2501.htm"{84} I0750 Source "t2501" (109 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t2501.htm.lst" created, size=1073. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t2501. bin
0000: 11 1A 1B 1C 22 2A 2B 2C 33 44                    ····"*+,3D

▲Back to the top▲