home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / dos / bdisk / asmsrc / botsec.asm next >
Encoding:
Assembly Source File  |  1987-12-09  |  2.7 KB  |  94 lines

  1.         DOSSEG
  2.         .MODEL medium
  3.  
  4.         PUBLIC _BootSec
  5.  
  6. ;========================================================
  7. ; Boot sector declaration.  The 512 bytes of data
  8. ; specified by the _BootSec label is a valid boot sector
  9. ; for a DS/DD 5 1/4" floppy disk.  The sector may be
  10. ; modified for other types of disks by changing the
  11. ; data in the first declaration part (the "standard disk
  12. ; data" as described below).
  13.  
  14.         .DATA
  15.  
  16. VER_HI  EQU 1           ;version number, high digit
  17. VER_LO  EQU 0           ;version number, low digit
  18.  
  19. BOTLOC  EQU 7c00h       ;location sector is loaded, 0000:BOTLOC
  20. SECSIZ  EQU 512         ;sector size (used only for padding)
  21.  
  22.         ASSUME cs:@DATA, ss:NOTHING
  23.  
  24. _BootSec LABEL BYTE
  25.  
  26. ;--- standard disk data
  27.  
  28.         jmp     BotRnt
  29.  
  30.         db      'BDISK',VER_HI+'0',VER_LO+'0','0' ;OEM name
  31.  
  32.         dw      512             ;bytes per sector
  33.         db      2               ;sectors per cluster
  34.         dw      1               ;reserved sectors
  35.         db      2               ;number of FATs
  36.         dw      112             ;root directory entries
  37.         dw      720             ;total sectors
  38.         db      0fdh            ;media descriptor
  39.         dw      2               ;sectors per FAT
  40.  
  41.         dw      9               ;sectors per track
  42.         dw      2               ;number of heads
  43.         dw      0               ;number of hidden sectors
  44.  
  45. ;--- non-standard data (offset BOTLOC + 1eH)
  46.  
  47.         dw      40              ;number of tracks
  48.         dw      40              ;sectors used by directory
  49.  
  50.         db      32 DUP (?)      ;reserved
  51.  
  52. ;--- local data (offset BOTLOC + 42H)
  53.  
  54.         db      13,10
  55.         db      'BDISK Library Format ',VER_HI+'0','.',VER_LO+'0',13,10
  56.         db      'By Eric Tauck [72457,1557]',13,10
  57.         db      13,10
  58.         db      'Non-System disk or disk error',13,10
  59.         db      'Replace and strike any key when ready',13,10
  60.         db      13,10
  61.         db      0
  62.  
  63. ;=== boot routine
  64.  
  65. BotRnt: sub ax, ax
  66.         mov ds, ax
  67.         cli
  68.         mov ss, ax
  69.         mov sp, BOTLOC
  70.         sti
  71.  
  72.         mov bl, 07h             ;foreground color (probably unnecessary)
  73.         mov si, BOTLOC+42H      ;start of message
  74.  
  75. Btrt1:  lodsb           ;get next byte
  76.         or al, al       ;check if done
  77.         jz Btrt2
  78.  
  79.         push si
  80.         mov ah, 14      ;function number
  81.         int 10h         ;display character
  82.         pop si
  83.         jmp Btrt1
  84.  
  85. Btrt2:  sub ah, ah      ;function number
  86.         int 16h         ;wait for key
  87.  
  88.         int 19h         ;redo bootstrap
  89.  
  90. Datend  LABEL BYTE
  91.         db ((OFFSET _BootSec + SECSIZ) - OFFSET Datend) DUP (0)
  92.  
  93.         END
  94.