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

# Test t8050: BIN program for 16bit DOS

Tested procedures
  PfbinCompile

Source & expected listing t8050.htm.lst
  `| | EUROASM AUTOSEGMENT=ON,CPU=086,DUMPWIDTH=24 |7438303530 |%test %SET t8050 ; BIN.D16 |00000000: | | |%test PROGRAM FORMAT=BIN,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:E80600 | CALL Write.D16: |0007:E81200 | CALL Beep.D16: |000A:E81C00 | CALL Exit.D16: | |;; |000D: |Write.D16:: PROC ; Display ASCIIZ string pointed to by DS:SI using DOS. |000D:B402 | MOV AH,02h ; DOS service Teletype output. |000F:8A14 |.1:MOV DL,[SI] ; Load a character from string to DL, increment SI. |0011:80FA00 | CMP DL,0 ; Test if zero-terminator reached. |0014:7405 | JE .9: ; Exit the procedure if AL=0. |0016:CD21 | INT 21h ; Otherwise display the character DL and advance screen cursor. |0018:46 | INC SI ; Let DS:SI point to the next character. |0019:EBF4 | JMP .1: ; Repeat with following characters. |001B:C3 |.9:RET ; AX,BX,SI are clobbered. |001C: | ENDP Write.D16:: | |;; |001C: |Beep.D16:: PROC ; Display message "Beeping.." and play a sound using BIOS. |001C:BE[0000] | MOV SI,=B"Beeping..." ; Define a literal string. Assume DS=PARA# [RODATA}. |001F:E8EBFF | CALL Write.D16:: ; Display the notification "Beeping...". |0022:BE[0000] | MOV SI,=W(0x0007) ; Define ASCIIZ string with BEL character in [RODATA]. |0025:E8E5FF | CALL Write.D16:: ; Play the beep sound. |0028:C3 | RET ; AX,BX,SI are clobbered. |0029: | ENDP Beep.D16:: | |;; |0029: |Exit.D16:: PROC ; Display message "End", terminate Terminate the program. |0029:BE[0000] | MOV SI,.M: ; String "End" will be defined in segment [BSS] at DS:SI. |002C:C704456E | MOVW [SI+0],"En" ; Dynamically initialize the notification string. |0030:C744026420 | MOVW [SI+2],"d " ; Assume DS=PARA# [BSS]. |0035:C744040A0D | MOVW [SI+4],0x0D0A ; CR+LF. |003A:C6440600 | MOVB [SI+6],0 ; Zero-terminate the notification. |003E:E8CCFF | CALL Write.D16:: ; Display notification "End". |0041:B44C | MOV AH,4Ch ; DOS function EXIT. |0043: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. |0045: | ENDP Exit.D16:: | |;; |[DATA] ::::Section changed. |0000:3136626974205449~|Msg:DB '%^WIDTH[]bit %^MODEL %^FORMAT program "%^OUTFILE".',13,10,0 |[@LT2] ====ListLiterals in section [@LT2]. |0000:0700 =W(0x0007) |[@LT1] ====ListLiterals in section [@LT1]. |0000:42656570696E672E~=B"Beeping..." | | ENDPROGRAM %test | **** ListMap "t8050.bin",model=TINY,groups=1,segments=4,entry=,stack=[COMGROUP]:0000FFFEh | [COMGROUP],FA=00000000h,VA=00000000h,size=00000097h=151,group [CODE] [RODATA] [DATA] [BSS] | [CODE],FA=00000000h,VA=00000000h,size=00000045h=69,width=16,align=0010h,purpose=CODE | [RODATA],FA=00000050h,VA=00000050h,size=0000000Dh=13,width=16,align=0010h,purpose=RODATA+LITERAL | [DATA],FA=00000060h,VA=00000060h,size=00000026h=38,width=16,align=0010h,purpose=DATA | [BSS],FA=00000090h,VA=00000090h,size=00000007h=7,width=16,align=0010h,purpose=BSS | **** ListGlobals "t8050.bin",Global=0,Public=3,Extern=0,eXport=0,Import=0 | Beep.D16,[COMGROUP]:0000001Ch,VA=0000001Ch,scope='P' | Exit.D16,[COMGROUP]:00000029h,VA=00000029h,scope='P' | Write.D16,[COMGROUP]:0000000Dh,VA=0000000Dh,scope='P' |00000000: |`

Expected messages t8050.out
  `I0180 Assembling source file "t8050.htm". I0270 Assembling source "t8050". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8050". "t8050.htm"{51} I0510 Assembling program pass 1. "t8050.htm"{51} I0510 Assembling program pass 2. "t8050.htm"{51} I0530 Assembling program pass 3 - final. "t8050.htm"{51} I0660 16bit TINY BIN file "t8050.bin" created, size=134. "t8050.htm"{98} I0650 Program "t8050" assembled in 3 passes with errorlevel 0. "t8050.htm"{98} I0750 Source "t8050" (141 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t8050.htm.lst" created, size=4412. I0990 EuroAssembler terminated with errorlevel 0.`

Expected output file t8050. bin

      0000: 90 BE 60 00 E8 06 00 E8 12 00 E8 1C 00 B4 02 8A  ¤¤`°¤·°¤·°¤·°¤·¤
      0010: 14 80 FA 00 74 05 CD 21 46 EB F4 C3 BE 52 00 E8  ·¤¤°t·¤!F¤¤¤¤R°¤
      0020: EB FF BE 50 00 E8 E5 FF C3 BE 90 00 C7 04 45 6E  ¤¤¤P°¤¤¤¤¤¤°¤·En
      0030: C7 44 02 64 20 C7 44 04 0A 0D C6 44 06 00 E8 CC  ¤D·d¯¤D·¬·¤D·°¤¤
      0040: FF B4 4C CD 21 00 00 00 00 00 00 00 00 00 00 00  ¤¤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 42 49 4E 20 70  16bit¯TINY¯BIN¯p
      0070: 72 6F 67 72 61 6D 20 22 74 38 30 35 30 2E 62 69  rogram¯"t8050.bi
      0080: 6E 22 2E 0D 0A 00                                n".·¬°

▲Back to the top▲