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

# Test t8118: BOOT sector for 16bit BIOS links LIBCOF library.

Source & expected listing t8118.htm.lst
  `| | EUROASM AUTOSEGMENT=ON,CPU=086,DUMPWIDTH=24,PRIV=ENABLED |7438313138 |%test %SET t8118 ; BIN.B16 links LIBCOF.B16 | |;; Create the first auxilliary COFF module "%test.WB.obj". | |%test.WB PROGRAM FORMAT=COFF,WIDTH=16,MODEL=TINY | |;; |[CODE] ::::Section changed. |0000: |Write.B16:: PROC ; Display ASCIIZ string pointed to by DS:SI using BIOS. |0000:31DB | XOR BX,BX ; Videopage=0. |0002:B40E | MOV AH,0Eh ; BIOS service Teletype output. |0004:FC | CLD ; Direction forward. |0005:AC |.1:LODSB ; Load a character from string to AL, increment SI. |0006:3C00 | CMP AL,0 ; Test if zero-terminator reached. |0008:7404 | JE .9: ; Exit the procedure if AL=0. |000A:CD10 | INT 10h ; Otherwise display the character AL and advance screen cursor. |000C:EBF7 | JMP .1: ; Repeat with following characters. |000E:C3 |.9:RET ; AX,BX,SI are clobbered. |000F: | ENDP Write.B16:: | |;; |000F: |Beep.B16:: 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.B16:: ; Display the notification "Beeping...". |0015:BE[0000] | MOV SI,=W(0x0007) ; Define ASCIIZ string with BEL character in [RODATA]. |0018:E8E5FF | CALL Write.B16:: ; Play the beep sound. |001B:C3 | RET ; AX,BX,SI are clobbered. |001C: | ENDP Beep.B16:: |[@LT2] ====ListLiterals in section [@LT2]. |0000:0700 =W(0x0007) |[@LT1] ====ListLiterals in section [@LT1]. |0000:42656570696E672E~=B"Beeping..." | | ENDPROGRAM %test.WB | **** ListMap "t8118.WB.obj",model=TINY,groups=1,segments=2,entry=,stack=[COMGROUP]:00002000h | [COMGROUP],FA=00000064h,RVA=00000000h,size=0000001Ch=28,group [CODE] [RODATA] | [CODE],FA=00000064h,RVA=00000000h,size=0000001Ch=28,width=16,align=0010h,purpose=CODE | [RODATA],FA=00000094h,RVA=00000000h,size=0000000Dh=13,width=16,align=0010h,purpose=RODATA+LITERAL | **** ListGlobals "t8118.WB.obj",Global=0,Public=2,Extern=0,eXport=0,Import=0 | Beep.B16,[COMGROUP]:0000000Fh,scope='P' | Write.B16,[COMGROUP]:00000000h,scope='P' | |;; | |;; Create the second auxilliary COFF module "%test.EX.obj". | |%test.EX PROGRAM FORMAT=COFF,WIDTH=16,MODEL=TINY |[CODE] ::::Section changed. |0000: |Exit.B16:: PROC ; Display message "End", terminate Terminate the program by endless loop. |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.B16:: ; Display notification "End". |0018:F4 |.9:HLT ; Assume there is no OS to return. |0019: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. |001B: | ENDP Exit.B16:: | | ENDPROGRAM %test.EX | **** ListMap "t8118.EX.obj",model=TINY,groups=1,segments=2,entry=,stack=[COMGROUP]:00002000h | [COMGROUP],FA=00000000h,RVA=00000000h,size=0000001Bh=27,group [CODE] [BSS] | [CODE],FA=00000064h,RVA=00000000h,size=0000001Bh=27,width=16,align=0010h,purpose=CODE | [BSS],FA=00000000h,RVA=00000000h,size=00000007h=7,width=16,align=0010h,purpose=BSS | **** ListGlobals "t8118.EX.obj",Global=0,Public=1,Extern=1,eXport=0,Import=0 | Exit.B16,[COMGROUP]:00000000h,scope='P' | Write.B16,[Write.B16]:00000000h,scope='E' | |;; | |;; Create auxilliary LIBCOF library "%test.lib" from two COFF modules. | |%test PROGRAM FORMAT=LIBCOF,WIDTH=16,MODEL=TINY | | LINK "%test.WB.obj", "%test.EX.obj" | | ENDPROGRAM %test |# I0560 Linking COFF module "./t8118.WB.obj". |# I0560 Linking COFF module "./t8118.EX.obj". | **** ListMap "t8118.lib",model=TINY,groups=0,segments=0,entry=,stack= | **** ListGlobals "t8118.lib",Global=0,Public=0,Extern=0,eXport=0,Import=0 | |;; | |;; Create the BOOT sector "%test.sec". | |%test PROGRAM FORMAT=BOOT,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.B16:: |0007:E8(0000) | CALL Beep.B16:: |000A:E8(0000) | CALL Exit.B16:: | | LINK "%test.lib" | |;; Define Msg in [DATA] segment. |[DATA] ::::Section changed. |0000:3136626974205449~|Msg:DB '%^WIDTH[]bit %^MODEL %^FORMAT program "%^OUTFILE".',13,10,0 | | ENDPROGRAM %test |# I0561 Linking LIBCOF library "./t8118.lib". | **** ListMap "t8118.sec",model=TINY,groups=1,segments=5,entry=,stack=[COMGROUP]:0000FFFEh | [COMGROUP],FA=00000000h,VA=00000000h,size=00007C97h=31895,group [PSP] [CODE] [RODATA] [DATA] [BSS] | [PSP],FA=00000000h,VA=00000000h,size=00007C00h=31744,width=0,align=0,purpose=PHDR | [CODE],FA=00000000h,VA=00007C00h,size=0000004Bh=75,width=16,align=0010h,purpose=CODE | [RODATA],FA=00000050h,VA=00007C50h,size=0000000Dh=13,width=16,align=0010h,purpose=RODATA | [DATA],FA=00000060h,VA=00007C60h,size=00000027h=39,width=16,align=0010h,purpose=DATA | [BSS],FA=00000090h,VA=00007C90h,size=00000007h=7,width=16,align=0010h,purpose=BSS | **** ListGlobals "t8118.sec",Global=0,Public=3,Extern=0,eXport=0,Import=0 | Beep.B16,[COMGROUP]:00007C1Fh,RVA=00007C1Fh,scope='P' | Exit.B16,[COMGROUP]:00007C30h,RVA=00007C30h,scope='P' | Write.B16,[COMGROUP]:00007C10h,RVA=00007C10h,scope='P'`

Expected messages t8118.out
  `I0180 Assembling source file "t8118.htm". I0270 Assembling source "t8118". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8118.WB". "t8118.htm"{44} I0510 Assembling program pass 1. "t8118.htm"{44} I0510 Assembling program pass 2. "t8118.htm"{44} I0530 Assembling program pass 3 - final. "t8118.htm"{44} I0660 16bit TINY COFF file "t8118.WB.obj" created, size=478. "t8118.htm"{70} I0650 Program "t8118.WB" assembled in 3 passes with errorlevel 0. "t8118.htm"{70} I0470 Assembling program "t8118.EX". "t8118.htm"{80} I0510 Assembling program pass 1. "t8118.htm"{80} I0510 Assembling program pass 2. "t8118.htm"{80} I0530 Assembling program pass 3 - final. "t8118.htm"{80} I0660 16bit TINY COFF file "t8118.EX.obj" created, size=364. "t8118.htm"{95} I0650 Program "t8118.EX" assembled in 3 passes with errorlevel 0. "t8118.htm"{95} I0470 Assembling program "t8118". "t8118.htm"{105} I0510 Assembling program pass 1. "t8118.htm"{105} I0530 Assembling program pass 2 - final. "t8118.htm"{105} I0560 Linking COFF module "./t8118.WB.obj". "t8118.htm"{107} I0560 Linking COFF module "./t8118.EX.obj". "t8118.htm"{107} I0660 16bit TINY LIBCOF file "t8118.lib" created, size=1314. "t8118.htm"{107} I0650 Program "t8118" assembled in 2 passes with errorlevel 0. "t8118.htm"{107} I0470 Assembling program "t8118". "t8118.htm"{114} I0510 Assembling program pass 1. "t8118.htm"{114} I0510 Assembling program pass 2. "t8118.htm"{114} I0530 Assembling program pass 3 - final. "t8118.htm"{114} I0561 Linking LIBCOF library "./t8118.lib". "t8118.htm"{125} I0660 16bit TINY BOOT file "t8118.sec" created, size=512. "t8118.htm"{125} I0650 Program "t8118" assembled in 3 passes with errorlevel 0. "t8118.htm"{125} I0750 Source "t8118" (212 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t8118.htm.lst" created, size=7008. I0990 EuroAssembler terminated with errorlevel 0.`

Expected output file t8118. sec

      0000: 90 BE 60 7C E8 09 00 E8 15 00 E8 23 00 90 90 90  ¤¤`|¤·°¤·°¤#°¤¤¤
      0010: 31 DB B4 0E FC AC 3C 00 74 04 CD 10 EB F7 C3 BE  1¤¤·¤¤<°t·¤·¤¤¤¤
      0020: 52 7C E8 EB FF BE 50 7C E8 E5 FF C3 90 90 90 90  R|¤¤¤¤P|¤¤¤¤¤¤¤¤
      0030: BE 90 7C 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 F4 EB FD 00 00 00 00 00  ·¤D·°¤¤¤¤¤¤°°°°°
      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 4F 4F 54 20  16bit¯TINY¯BOOT¯
      0070: 70 72 6F 67 72 61 6D 20 22 74 38 31 31 38 2E 73  program¯"t8118.s
      0080: 65 63 22 2E 0D 0A 00 00 00 00 00 00 00 00 00 00  ec".·¬°°°°°°°°°°
      0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      00A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      00C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      01A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      01B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      01C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      01D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      01E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
      01F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA  °°°°°°°°°°°°°°U¤

▲Back to the top▲