EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t2520: Sections and segments


Description
Sample program with multiple sections.
Tested procedures
PseudopcDISPLAY  
Source & expected listing t2520.htm.lst
| | EUROASM LIST=ON,DUMP=ON,DUMPWIDTH=24 | |t2520 PROGRAM FORMAT=BIN,MODEL=SMALL,WIDTH=16,LISTGLOBALS=OFF,LISTLITERALS=ON,LISTMAP=ON |[MAIN_CODE] |[MAIN_CODE] SEGMENT PURPOSE=CODE ; Declare code segment [MAIN_CODE]. |0000: |; Section [MAIN_CODE] is declared here as well. |[PROCEDURES] |[PROCEDURES] ; This declares code section [PROCEDURES] in segment [MAIN_CODE]. |[DATA] |[DATA] SEGMENT PURPOSE=DATA ; Declare data segment [DATA] and data section [DATA]. |0000:11112222 | SomeData DW 0x1111,0x2222 ; Emit two WORDs to section [DATA] of segment [DATA]. |[PROCEDURES] |[PROCEDURES] ; Switch to already declared code section [PROCEDURES]. |0010: | SomeProc PROC ; Emit some code to section PROCEDURES]. |0010:A1[0000] | MOV AX,[SomeData] |0013:C3 | RET |0014: | ENDP SomeProc |[TABLES] |[TABLES] ; This declares a new code section in the current segment, which is [MAIN_CODE], |0020: | ; because previous section [PROCEDURES] belongs to segment [MAIN_CODE]. |0020:[1000][1400] | SomeTable DW SomeProc, OtherProc |[UNUSED] |[UNUSED] ; This section is intentionally not used. |[PROCEDURES] |[PROCEDURES] ; Switch to previously declared code section [PROCEDURES]. |0014: | OtherProc PROC ; Emit some more code to section PROCEDURES]. |0014:A1[0400] | MOV AX,[OtherData] |0017:BB[2000] | MOV BX,SomeTable |001A:C3 | RET |001B: | ENDP OtherProc |[MAIN_CODE] |[MAIN_CODE] ; Switch to the main code section. |0000:BA[1000] | MOV DX,SomeText |0003:B409 | MOV AH,9 |0005:CD21 | INT 21h |0007:BA[1800] | MOV DX,=B"End.$" ; Using literal data silently creates literal section [@LT1]. |000A:CD21 | INT 21h |000C:C3 | RET |[DATA] |[DATA] ; Switch to data section [DATA]. |0004:3333 | OtherData DW 0x3333 |[STRINGS] |[STRINGS] ; Declare new data section [STRINGS] in segment [DATA]. |0010:44656D6F2E0D0A24 |SomeText DB "Demo.",13,10,'$' | | %DISPLAY Segments ; Display all symbols, segments and sections to listing. |# D1250 **** %DISPLAY Groups, Segments, Sections |# D1270 [MAIN_CODE],purpose=CODE,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{53} |# D1280 [MAIN_CODE],address=00000000h,size=0000000Dh=13,align=16,ref=Y,src="t2520.htm"{53} |# D1280 [PROCEDURES],address=00000010h,size=0000000Bh=11,align=16,ref=Y,src="t2520.htm"{55} |# D1280 [TABLES],address=00000020h,size=00000004h=4,align=16,ref=Y,src="t2520.htm"{63} |# D1280 [UNUSED],address=00000030h,size=00000000h=0,align=16,ref=N,src="t2520.htm"{66} |# D1270 [DATA],purpose=DATA,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{56} |# D1280 [DATA],address=00000000h,size=00000006h=6,align=16,ref=Y,src="t2520.htm"{56} |# D1280 [STRINGS],address=00000010h,size=00000008h=8,align=16,ref=Y,src="t2520.htm"{82} |# D1280 [@LT1],address=00000018h,size=00000006h=6,align=1,ref=Y,src="t2520.htm"{77} |# D1790 **** End of %DISPLAY |[@LT1] ====ListLiterals in section [@LT1]. |0018:456E642E2400 =B"End.$" | | ENDPROGRAM t2520 | **** ListMap "t2520.bin",groups=2,segments=2,entry=,stack= | [MAIN_CODE],VA=00000000h,size=00000030h=48,group [MAIN_CODE] | [MAIN_CODE],VA=00000000h,size=00000030h=48,width=16,align=16,purpose=CODE | [DATA],VA=00000030h,size=0000001Eh=30,group [DATA] | [DATA],VA=00000030h,size=0000001Eh=30,width=16,align=16,purpose=DATA
Expected messages t2520.out
I0180 Assembling source file "t2520.htm". I0270 Assembling source "t2520". I0310 Assembling source pass 1. D1250 **** %DISPLAY Groups, Segments, Sections "t2520.htm"{84} D1270 [BIN],purpose=CODE+DATA+BSS+STACK,width=16,align=16,combine=PUBLIC,class="",src= "t2520.htm"{84} D1280 [BIN],address=00000000h,size=00000000h=0,align=16,ref=N,src= "t2520.htm"{84} D1790 **** End of %DISPLAY "t2520.htm"{84} I0330 Assembling source pass 2 - final. I0470 Assembling program "t2520". "t2520.htm"{52} I0510 Assembling program pass 1. "t2520.htm"{52} D1250 **** %DISPLAY Groups, Segments, Sections "t2520.htm"{84} D1270 [BIN],purpose=CODE+DATA+BSS+STACK,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{52} "t2520.htm"{84} D1280 [BIN],address=00000000h,size=00000000h=0,align=16,ref=N,src="t2520.htm"{52} "t2520.htm"{84} D1270 [MAIN_CODE],purpose=CODE,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{53} "t2520.htm"{84} D1280 [MAIN_CODE],address=00000000h,size=0000000Dh=13,align=16,ref=Y,src="t2520.htm"{53} "t2520.htm"{84} D1280 [PROCEDURES],address=00000000h,size=0000000Bh=11,align=16,ref=Y,src="t2520.htm"{55} "t2520.htm"{84} D1280 [TABLES],address=00000000h,size=00000004h=4,align=16,ref=Y,src="t2520.htm"{63} "t2520.htm"{84} D1280 [UNUSED],address=00000000h,size=00000000h=0,align=16,ref=N,src="t2520.htm"{66} "t2520.htm"{84} D1270 [DATA],purpose=DATA+LITERAL,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{56} "t2520.htm"{84} D1280 [DATA],address=00000000h,size=00000006h=6,align=16,ref=Y,src="t2520.htm"{56} "t2520.htm"{84} D1280 [@LT1],address=00000000h,size=00000006h=6,align=1,ref=Y,src="t2520.htm"{77} "t2520.htm"{84} D1280 [STRINGS],address=00000000h,size=00000008h=8,align=16,ref=Y,src="t2520.htm"{82} "t2520.htm"{84} D1790 **** End of %DISPLAY "t2520.htm"{84} I0510 Assembling program pass 2. "t2520.htm"{52} D1250 **** %DISPLAY Groups, Segments, Sections "t2520.htm"{84} D1270 [MAIN_CODE],purpose=CODE,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{53} "t2520.htm"{84} D1280 [MAIN_CODE],address=00000000h,size=0000000Dh=13,align=16,ref=Y,src="t2520.htm"{53} "t2520.htm"{84} D1280 [PROCEDURES],address=00000010h,size=0000000Bh=11,align=16,ref=Y,src="t2520.htm"{55} "t2520.htm"{84} D1280 [TABLES],address=00000020h,size=00000004h=4,align=16,ref=Y,src="t2520.htm"{63} "t2520.htm"{84} D1280 [UNUSED],address=00000030h,size=00000000h=0,align=16,ref=N,src="t2520.htm"{66} "t2520.htm"{84} D1270 [DATA],purpose=DATA,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{56} "t2520.htm"{84} D1280 [DATA],address=00000000h,size=00000006h=6,align=16,ref=Y,src="t2520.htm"{56} "t2520.htm"{84} D1280 [STRINGS],address=00000010h,size=00000008h=8,align=16,ref=Y,src="t2520.htm"{82} "t2520.htm"{84} D1280 [@LT1],address=00000018h,size=00000006h=6,align=1,ref=Y,src="t2520.htm"{77} "t2520.htm"{84} D1790 **** End of %DISPLAY "t2520.htm"{84} I0530 Assembling program pass 3 - final. "t2520.htm"{52} D1250 **** %DISPLAY Groups, Segments, Sections "t2520.htm"{84} D1270 [MAIN_CODE],purpose=CODE,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{53} "t2520.htm"{84} D1280 [MAIN_CODE],address=00000000h,size=0000000Dh=13,align=16,ref=Y,src="t2520.htm"{53} "t2520.htm"{84} D1280 [PROCEDURES],address=00000010h,size=0000000Bh=11,align=16,ref=Y,src="t2520.htm"{55} "t2520.htm"{84} D1280 [TABLES],address=00000020h,size=00000004h=4,align=16,ref=Y,src="t2520.htm"{63} "t2520.htm"{84} D1280 [UNUSED],address=00000030h,size=00000000h=0,align=16,ref=N,src="t2520.htm"{66} "t2520.htm"{84} D1270 [DATA],purpose=DATA,width=16,align=16,combine=PUBLIC,class="",src="t2520.htm"{56} "t2520.htm"{84} D1280 [DATA],address=00000000h,size=00000006h=6,align=16,ref=Y,src="t2520.htm"{56} "t2520.htm"{84} D1280 [STRINGS],address=00000010h,size=00000008h=8,align=16,ref=Y,src="t2520.htm"{82} "t2520.htm"{84} D1280 [@LT1],address=00000018h,size=00000006h=6,align=1,ref=Y,src="t2520.htm"{77} "t2520.htm"{84} D1790 **** End of %DISPLAY "t2520.htm"{84} I0660 16bit SMALL BIN file "t2520.bin" created, size=78. "t2520.htm"{98} I0650 Program "t2520" assembled in 3 passes with errorlevel 1. "t2520.htm"{98} I0750 Source "t2520" (170 lines) assembled in 2 passes with errorlevel 1. I0860 Listing file "t2520.htm.lst" created, size=3804. I0990 EuroAssembler terminated with errorlevel 1.
Expected output file t2520. bin
0000: BA 40 00 B4 09 CD 21 BA 48 00 CD 21 C3 90 90 90  ¤@°¤·¤!¤H°¤!¤¤¤¤
0010: A1 30 00 C3 A1 34 00 BB 20 00 C3 90 90 90 90 90  ¤0°¤¤4°¤¯°¤¤¤¤¤¤
0020: 10 00 14 00 90 90 90 90 90 90 90 90 90 90 90 90  ·°·°¤¤¤¤¤¤¤¤¤¤¤¤
0030: 11 11 22 22 33 33 00 00 00 00 00 00 00 00 00 00  ··""33°°°°°°°°°°
0040: 44 65 6D 6F 2E 0D 0A 24 45 6E 64 2E 24 00        Demo.·¬$End.$°

▲Back to the top▲