EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t8200: COM program for 16bit BIOS


Source & expected listing t8200.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=086,DUMPWIDTH=24,PRIV=ENABLED | |t8200 PROGRAM FORMAT=COM,WIDTH=16,MODEL=TINY,ENTRY=Start |[CODE] ::::Section changed. |0000:90 |Start:NOP ; Entry point of the executable program. |0001:BE[0000] | MOV SI,Msg |0004:E80600 | CALL Write.B16:: |0007:E81200 | CALL Beep.B16:: |000A:E81C00 | CALL Exit.B16:: | |;; |000D: |Write.B16:: PROC ; Display ASCIIZ string pointed to by DS:SI using BIOS. |000D:31DB | XOR BX,BX ; Videopage=0. |000F:B40E | MOV AH,0Eh ; BIOS service Teletype output. |0011:FC | CLD ; Direction forward. |0012:AC |.1:LODSB ; Load a character from string to AL, increment SI. |0013:3C00 | CMP AL,0 ; Test if zero-terminator reached. |0015:7404 | JE .9: ; Exit the procedure if AL=0. |0017:CD10 | INT 10h ; Otherwise display the character AL and advance screen cursor. |0019:EBF7 | JMP .1: ; Repeat with following characters. |001B:C3 |.9:RET ; AX,BX,SI are clobbered. |001C: | ENDP Write.B16:: | |;; |001C: |Beep.B16:: 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.B16: ; Display the notification "Beeping...". |0022:BE[0000] | MOV SI,=W(0x0007) ; Define ASCIIZ string with BEL character in [RODATA]. |0025:E8E5FF | CALL Write.B16: ; Play the beep sound. |0028:C3 | RET ; AX,BX,SI are clobbered. |0029: | ENDP Beep.B16:: | |;; |0029: |Exit.B16:: PROC ; Display message "End", terminate Terminate the program by endless loop. |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.B16: ; Display notification "End". |0041:F4 |.9:HLT ; Assume there is no OS to return. |0042:EBFD | JMP .9: ; Terminate in endless loop. |[BSS] ::::Section changed. |0000:.............. |.M:DB 7*BYTE ; Reserve space for ASCIIZ string "End" in [BSS] segment. |[CODE] ::::Section changed. |0044: | ENDP Exit.B16:: | |;; |[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 t8200 | **** ListMap "t8200.com",model=TINY,groups=1,segments=5,entry=Start,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=00000044h=68,width=16,align=0010h,purpose=CODE | [RODATA],FA=00000050h,RVA=00000150h,size=0000000Dh=13,width=16,align=0010h,purpose=RODATA+LITERAL | [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 "t8200.com",Global=0,Public=4,Extern=0,eXport=0,Import=0 | Beep.B16,[COMGROUP]:0000011Ch,RVA=0000011Ch,scope='P' | Exit.B16,[COMGROUP]:00000129h,RVA=00000129h,scope='P' | Start,[COMGROUP]:00000100h,RVA=00000100h,scope='P' | Write.B16,[COMGROUP]:0000010Dh,RVA=0000010Dh,scope='P'
Expected messages t8200.out
I0180 Assembling source file "t8200.htm". I0270 Assembling source "t8200". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8200". "t8200.htm"{42} I0510 Assembling program pass 1. "t8200.htm"{42} I0510 Assembling program pass 2. "t8200.htm"{42} I0530 Assembling program pass 3 - final. "t8200.htm"{42} I0660 16bit TINY COM file "t8200.com" created, size=134. "t8200.htm"{90} I0650 Program "t8200" assembled in 3 passes with errorlevel 0. "t8200.htm"{90} I0750 Source "t8200" (134 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t8200.htm.lst" created, size=4563. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t8200. com
0000: 90 BE 60 01 E8 06 00 E8 12 00 E8 1C 00 31 DB B4  ¤¤`·¤·°¤·°¤·°1¤¤
0010: 0E FC AC 3C 00 74 04 CD 10 EB F7 C3 BE 52 01 E8  ·¤¤<°t·¤·¤¤¤¤R·¤
0020: EB FF BE 50 01 E8 E5 FF C3 BE 90 01 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 F4 EB FD 00 00 00 00 00 00 00 00 00 00 00 00  ¤¤¤¤°°°°°°°°°°°°
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 30 30 2E 63 6F  rogram¯"t8200.co
0080: 6D 22 2E 0D 0A 00                                m".·¬°

▲Back to the top▲