EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t7466: Compile COM 16bit Dos linking COFF 16bit Dos


Description
Test creates executable 16bit COM file t7466.com from linkable 16bit COFF module.
See also
LinkerCombinations  
Tested procedures
PfcomCompile   PfcoffLoadPgm  
Source & expected listing t7466.htm.lst
| |EUROASM DEBUG=OFF,PROFILE=OFF,AUTOSEGMENT=ON,LIST=ON, \ | |DUMP=ON,DUMPWIDTH=25,DUMPALL=OFF,CPU=086 | |;; | |t7466C PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=16, \ | |LISTMAP=ON,LISTGLOBALS=ON | |PUBLIC Write.D16, Beep.D16, Exit.D16 |[.text] ::::Section changed. |0000: |Write.D16: PROC ; Write ASCIIZ string DS:SI in 16bit DOS. |0000:B402 |MOV AH,02h ; Dos function WRITE CHARACTER FROM DL TO STANDARD OUTPUT. |0002:8A14 |.1:MOV DL,[SI] ; Get one character. |0004:84D2 |TEST DL ; Test if it is the terminating zero. |0006:7405 |JZ .9: ; Go to the end if so. |0008:CD21 |INT 21h ; Call DOS service to write a character. |000A:46 |INC SI ; Let SI point to the next character. |000B:EBF5 |JMP .1: ; Repeat until DL=0. |000D:C3 |.9:RET |000E: |ENDPROC Write.D16: |000E: |Beep.D16: PROC ; Echo beep sound in 16bit DOS. |000E:B207 |MOV DL,7 ; BEL character, interpreted as beep sound. |0010:B402 |MOV AH,2 ; DOS function WRITE CHARACTER TO STANDARD OUTPUT. |0012:CD21 |INT 0x21 ; Call DOS service to send a BEL. |0014:C3 |RET ; Return to caller. |0015: |ENDPROC Beep.D16: |0015: |Exit.D16: PROC ; Terminate program in 16bit DOS. |0015:B8004C |MOV AX,4C00h ; DOS function TERMINATE WITH RETURN CODE IN AL. |0018:CD21 |INT 21h ; Call DOS service to terminate the program. |001A: |ENDPROC Exit.D16: | |ENDPROGRAM t7466C | **** ListMap "t7466C.obj",groups=0,segments=1,entry=,stack= | [.text],RVA=00000000h,size=0000001Ah=26,width=16,align=16,purpose=CODE | **** ListGlobals "t7466C.obj",Global=0,Public=3,Extern=0,eXport=0,Import=0 | Beep.D16,[.text]:0000000Eh,scope='P' | Exit.D16,[.text]:00000015h,scope='P' | Write.D16,[.text]:00000000h,scope='P' | |;; | |t7466 PROGRAM FORMAT=COM,MODEL=TINY,WIDTH=16, \ | |LISTMAP=ON ,LISTGLOBALS=ON | |LINK t7466C.obj |[COM] ::::Section changed. |0100:90 |NOP ; Unsignificant code marker. |0101:BE[0D01] |MOV SI,Message: ; Offset of the message. |0104:E8(0000) |CALL Write.D16: ; Write the ASCIIZ string DS:SI. |0107:E8(0000) |CALL Beep.D16: ; Play a beep sound. |010A:E8(0000) |CALL Exit.D16: ; Terminate the program with errorlevel 0. |010D:313662697420434F~~|Message: DB "16bit COM program t7466.com created by EuroAssembler linking 16bit COFF.",13,10,0 | |EXTERN Write.D16, Beep.D16, Exit.D16 | |ENDPROGRAM t7466 |# I0560 Linking COFF module ".\t7466C.obj". | **** ListMap "t7466.com",groups=1,segments=2,entry=[COM]:00000100h,stack=[COM]:0000FFFEh | [COM],RVA=00000000h,size=0000017Ah=378,group [COM] [.text] | [COM],RVA=00000000h,size=00000158h=344,width=16,align=16,purpose=CODE+DATA+BSS+STACK | [.text],RVA=00000160h,size=0000001Ah=26,width=16,align=16,purpose=CODE | **** ListGlobals "t7466.com",Global=3,Public=0,Extern=0,eXport=0,Import=0 | Beep.D16,[COM]:0000016Eh,RVA=0000016Eh,scope='G' | Exit.D16,[COM]:00000175h,RVA=00000175h,scope='G' | Write.D16,[COM]:00000160h,RVA=00000160h,scope='G'
Expected messages t7466.out
I0180 Assembling source file "t7466.htm". I0270 Assembling source "t7466". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t7466C". "t7466.htm"{61} I0510 Assembling program pass 1. "t7466.htm"{61} I0510 Assembling program pass 2. "t7466.htm"{61} I0530 Assembling program pass 3 - final. "t7466.htm"{61} I0660 16bit FLAT COFF file "t7466C.obj" created, size=304. "t7466.htm"{85} I0650 Program "t7466C" assembled in 3 passes with errorlevel 0. "t7466.htm"{85} I0470 Assembling program "t7466". "t7466.htm"{93} I0510 Assembling program pass 1. "t7466.htm"{93} I0510 Assembling program pass 2. "t7466.htm"{93} I0530 Assembling program pass 3 - final. "t7466.htm"{93} I0560 Linking COFF module ".\t7466C.obj". "t7466.htm"{104} I0660 16bit TINY COM file "t7466.com" created, size=122. "t7466.htm"{104} I0650 Program "t7466" assembled in 3 passes with errorlevel 0. "t7466.htm"{104} I0750 Source "t7466" (151 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t7466.htm.lst" created, size=3757. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t7466. com
0000: 90 BE 0D 01 E8 59 00 E8 64 00 E8 68 00 31 36 62  ¤¤··¤Y°¤d°¤h°16b
0010: 69 74 20 43 4F 4D 20 70 72 6F 67 72 61 6D 20 74  it¯COM¯program¯t
0020: 37 34 36 36 2E 63 6F 6D 20 63 72 65 61 74 65 64  7466.com¯created
0030: 20 62 79 20 45 75 72 6F 41 73 73 65 6D 62 6C 65  ¯by¯EuroAssemble
0040: 72 20 6C 69 6E 6B 69 6E 67 20 31 36 62 69 74 20  r¯linking¯16bit¯
0050: 43 4F 46 46 2E 0D 0A 00 00 00 00 00 00 00 00 00  COFF.·¬°°°°°°°°°
0060: B4 02 8A 14 84 D2 74 05 CD 21 46 EB F5 C3 B2 07  ¤·¤·¤¤t·¤!F¤¤¤¤·
0070: B4 02 CD 21 C3 B8 00 4C CD 21                    ¤·¤!¤¤°L¤!

▲Back to the top▲