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

# Test t8257: COM program for 16bit DOS links LIBOMF library

Source & expected listing t8257.htm.lst
  `| | EUROASM AUTOSEGMENT=ON,CPU=086,DUMPWIDTH=24,PRIV=ENABLED |7438323537 |%test %SET t8257 ; COM.D16 links LIBOMF.D16 |00000000: | | |;; Create the first auxilliary OMF module "%test.WB.obj". | |%test.WB PROGRAM FORMAT=OMF,WIDTH=16,MODEL=TINY | |;; |[CODE] ::::Section changed. |0000: |Write.D16:: PROC ; Display ASCIIZ string pointed to by DS:SI using DOS. |0000:B402 | MOV AH,02h ; DOS service Teletype output. |0002:8A14 |.1:MOV DL,[SI] ; Load a character from string to DL, increment SI. |0004:80FA00 | CMP DL,0 ; Test if zero-terminator reached. |0007:7405 | JE .9: ; Exit the procedure if AL=0. |0009:CD21 | INT 21h ; Otherwise display the character DL and advance screen cursor. |000B:46 | INC SI ; Let DS:SI point to the next character. |000C:EBF4 | JMP .1: ; Repeat with following characters. |000E:C3 |.9:RET ; AX,BX,SI are clobbered. |000F: | ENDP Write.D16:: | |;; |000F: |Beep.D16:: PROC ; Display message "Beeping.." and play a sound using BIOS. |000F:BE[0000] | MOV SI,=B"Beeping..." ; Define a literal string. Assume DS=PARA# [RODATA}. |0012:E8EBFF | CALL Write.D16:: ; Display the notification "Beeping...". |0015:BE[0000] | MOV SI,=W(0x0007) ; Define ASCIIZ string with BEL character in [RODATA]. |0018:E8E5FF | CALL Write.D16:: ; Play the beep sound. |001B:C3 | RET ; AX,BX,SI are clobbered. |001C: | ENDP Beep.D16:: |[@LT2] ====ListLiterals in section [@LT2]. |0000:0700 =W(0x0007) |[@LT1] ====ListLiterals in section [@LT1]. |0000:42656570696E672E~=B"Beeping..." | | ENDPROGRAM %test.WB | **** ListMap "t8257.WB.obj",model=TINY,groups=1,segments=2,entry=,stack=[COMGROUP]:0000001Ch | [COMGROUP],FA=00000084h,RVA=00000000h,size=0000001Ch=28,group [CODE] [RODATA] | [CODE],FA=00000084h,RVA=00000000h,size=0000001Ch=28,width=16,align=0010h,purpose=CODE | [RODATA],FA=000000B5h,RVA=00000000h,size=0000000Dh=13,width=16,align=0010h,purpose=RODATA+LITERAL | **** ListGlobals "t8257.WB.obj",Global=0,Public=2,Extern=0,eXport=0,Import=0 | Beep.D16,[COMGROUP]:0000000Fh,scope='P' | Write.D16,[COMGROUP]:00000000h,scope='P' | |;; | |;; Create the second auxilliary OMF module "%test.EX.obj". | |%test.EX PROGRAM FORMAT=OMF,WIDTH=16,MODEL=TINY |[CODE] ::::Section changed. |0000: |Exit.D16:: PROC ; Display message "End", terminate Terminate the program. |0000:BE[0000] | MOV SI,.M: ; String "End" will be defined in segment [BSS] at DS:SI. |0003:C704456E | MOVW [SI+0],"En" ; Dynamically initialize the notification string. |0007:C744026420 | MOVW [SI+2],"d " ; Assume DS=PARA# [BSS]. |000C:C744040A0D | MOVW [SI+4],0x0D0A ; CR+LF. |0011:C6440600 | MOVB [SI+6],0 ; Zero-terminate the notification. |0015:E8(0000) | CALL Write.D16:: ; Display notification "End". |0018:B44C | MOV AH,4Ch ; DOS function EXIT. |001A:CD21 | INT 21h ; Terminate program and return to DOS. |[BSS] ::::Section changed. |0000:.............. |.M:DB 7*BYTE ; Reserve space for ASCIIZ string "End" in [BSS] segment. |[CODE] ::::Section changed. |001C: | ENDP Exit.D16:: | | ENDPROGRAM %test.EX | **** ListMap "t8257.EX.obj",model=TINY,groups=1,segments=2,entry=,stack=[COMGROUP]:0000001Ch | [COMGROUP],FA=00000000h,RVA=00000000h,size=0000001Ch=28,group [CODE] [BSS] | [CODE],FA=0000007Dh,RVA=00000000h,size=0000001Ch=28,width=16,align=0010h,purpose=CODE | [BSS],FA=00000000h,RVA=00000000h,size=00000007h=7,width=16,align=0010h,purpose=BSS | **** ListGlobals "t8257.EX.obj",Global=0,Public=1,Extern=1,eXport=0,Import=0 | Exit.D16,[COMGROUP]:00000000h,scope='P' | Write.D16,[Write.D16]:00000000h,scope='E' | |;; | |;; Create auxilliary LIBOMF library "%test.lib". | |%test PROGRAM FORMAT=LIBOMF,WIDTH=16,MODEL=TINY | | LINK %test.WB.obj, %test.EX.obj | | ENDPROGRAM %test |# I0560 Linking OMF module "./t8257.WB.obj". |# I0560 Linking OMF module "./t8257.EX.obj". | **** ListMap "t8257.lib",model=TINY,groups=0,segments=0,entry=,stack= | **** ListGlobals "t8257.lib",Global=0,Public=0,Extern=0,eXport=0,Import=0 | |;; | |;; Create the main COM program "%test.com" from the LIBOMF library. | |%test PROGRAM FORMAT=COM,WIDTH=16,MODEL=TINY |[CODE] ::::Section changed. |0000:90 | NOP ; Entry point of COM program is fixed at CS:100h. |0001:BE[0000] | MOV SI,Msg |0004:E8(0000) | CALL Write.D16:: |0007:E8(0000) | CALL Beep.D16:: |000A:E8(0000) | CALL Exit.D16:: | | LINK %test.lib |[DATA] ::::Section changed. |0000:3136626974205449~|Msg::DB '%^WIDTH[]bit %^MODEL %^FORMAT program "%^OUTFILE".',13,10,0 | | ENDPROGRAM %test |# I0561 Linking LIBOMF library "./t8257.lib". | **** ListMap "t8257.com",model=TINY,groups=1,segments=5,entry=[COMGROUP]:00000100h,stack=[COMGROUP]:0000FFFEh | [COMGROUP],FA=00000000h,RVA=00000000h,size=00000197h=407,group [PSP] [CODE] [RODATA] [DATA] [BSS] | [PSP],FA=00000000h,RVA=00000000h,size=00000100h=256,width=0,align=0,purpose=PHDR | [CODE],FA=00000000h,RVA=00000100h,size=0000004Ch=76,width=16,align=0010h,purpose=CODE | [RODATA],FA=00000050h,RVA=00000150h,size=0000000Dh=13,width=16,align=0010h,purpose=RODATA | [DATA],FA=00000060h,RVA=00000160h,size=00000026h=38,width=16,align=0010h,purpose=DATA | [BSS],FA=00000090h,RVA=00000190h,size=00000007h=7,width=16,align=0010h,purpose=BSS | **** ListGlobals "t8257.com",Global=0,Public=4,Extern=0,eXport=0,Import=0 | Beep.D16,[COMGROUP]:0000011Fh,RVA=0000011Fh,scope='P' | Exit.D16,[COMGROUP]:00000130h,RVA=00000130h,scope='P' | Msg,[COMGROUP]:00000160h,RVA=00000160h,scope='P' | Write.D16,[COMGROUP]:00000110h,RVA=00000110h,scope='P'`

Expected messages t8257.out
  `I0180 Assembling source file "t8257.htm". I0270 Assembling source "t8257". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8257.WB". "t8257.htm"{45} I0510 Assembling program pass 1. "t8257.htm"{45} I0510 Assembling program pass 2. "t8257.htm"{45} I0530 Assembling program pass 3 - final. "t8257.htm"{45} I0660 16bit TINY OMF file "t8257.WB.obj" created, size=206. "t8257.htm"{70} I0650 Program "t8257.WB" assembled in 3 passes with errorlevel 0. "t8257.htm"{70} I0470 Assembling program "t8257.EX". "t8257.htm"{80} I0510 Assembling program pass 1. "t8257.htm"{80} I0510 Assembling program pass 2. "t8257.htm"{80} I0530 Assembling program pass 3 - final. "t8257.htm"{80} I0660 16bit TINY OMF file "t8257.EX.obj" created, size=177. "t8257.htm"{95} I0650 Program "t8257.EX" assembled in 3 passes with errorlevel 0. "t8257.htm"{95} I0470 Assembling program "t8257". "t8257.htm"{105} I0510 Assembling program pass 1. "t8257.htm"{105} I0530 Assembling program pass 2 - final. "t8257.htm"{105} I0560 Linking OMF module "./t8257.WB.obj". "t8257.htm"{107} I0560 Linking OMF module "./t8257.EX.obj". "t8257.htm"{107} I0660 16bit TINY LIBOMF file "t8257.lib" created, size=1536. "t8257.htm"{107} I0650 Program "t8257" assembled in 2 passes with errorlevel 0. "t8257.htm"{107} I0470 Assembling program "t8257". "t8257.htm"{114} I0510 Assembling program pass 1. "t8257.htm"{114} I0510 Assembling program pass 2. "t8257.htm"{114} I0530 Assembling program pass 3 - final. "t8257.htm"{114} I0561 Linking LIBOMF library "./t8257.lib". "t8257.htm"{124} I0660 16bit TINY COM file "t8257.com" created, size=134. "t8257.htm"{124} I0650 Program "t8257" assembled in 3 passes with errorlevel 0. "t8257.htm"{124} I0750 Source "t8257" (189 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t8257.htm.lst" created, size=6970. I0990 EuroAssembler terminated with errorlevel 0.`

Expected output file t8257. com

      0000: 90 BE 60 01 E8 09 00 E8 15 00 E8 23 00 90 90 90  ¤¤`·¤·°¤·°¤#°¤¤¤
      0010: B4 02 8A 14 80 FA 00 74 05 CD 21 46 EB F4 C3 BE  ¤·¤·¤¤°t·¤!F¤¤¤¤
      0020: 52 01 E8 EB FF BE 50 01 E8 E5 FF C3 90 90 90 90  R·¤¤¤¤P·¤¤¤¤¤¤¤¤
      0030: BE 90 01 C7 04 45 6E C7 44 02 64 20 C7 44 04 0A  ¤¤·¤·En¤D·d¯¤D·¬
      0040: 0D C6 44 06 00 E8 C8 FF B4 4C CD 21 00 00 00 00  ·¤D·°¤¤¤¤L¤!°°°°
      0050: 07 00 42 65 65 70 69 6E 67 2E 2E 2E 00 00 00 00  ·°Beeping...°°°°
      0060: 31 36 62 69 74 20 54 49 4E 59 20 43 4F 4D 20 70  16bit¯TINY¯COM¯p
      0070: 72 6F 67 72 61 6D 20 22 74 38 32 35 37 2E 63 6F  rogram¯"t8257.co
      0080: 6D 22 2E 0D 0A 00                                m".·¬°

▲Back to the top▲