home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / asm1.zip / BOOT.ASM < prev    next >
Assembly Source File  |  1986-06-05  |  3KB  |  120 lines

  1. ; Boot record program (C) Copyright Peter Norton 1986
  2.  
  3. boots segment 'code'
  4.  
  5.       public boot
  6.  
  7.       assume cs:boots
  8.  
  9. boot  proc  far
  10.  
  11. ;  30-byte DOS info -- set up for 1-side, 8-sector
  12. ;  change as needed for any other format
  13.  
  14. head:
  15.       jmp   begin       ; EB 2A 90 as per normal
  16.       db    ' Norton '  ; 8-byte system id
  17.       dw    512         ; sector size in bytes
  18.       db    1           ; sectors per cluster
  19.       dw    1           ; reserved clusters
  20.       db    2           ; number of fats
  21.       dw    64          ; root directory entries
  22.       dw    320         ; total sectors
  23.       db    0FEh        ; format id
  24.       dw    1           ; sectors per fat
  25.       dw    8           ; sectors per track
  26.       dw    1           ; sides
  27.       dw    0           ; special hidden sectors
  28.  
  29. ; mysterious but apparently standard 14-byte filler
  30.       db    14 dup (0)
  31.  
  32. ;  carry on with the boot work
  33.  
  34. begin:
  35.       mov   ax,07c0h ; boot record location
  36.       push  ax
  37.       pop   ds
  38.       mov   bx,message_offset  ; put offset to message into si
  39.       mov   cx,message_length  ; message length into cx
  40. continue:
  41.       mov   ah,14   ; write teletype
  42.       mov   al,[bx]
  43.       push  ds
  44.       push  cx
  45.       push  bx
  46.       int   10h
  47.       pop   bx
  48.       pop   cx
  49.       pop   ds
  50.       inc   bx
  51.       loop  continue
  52.  
  53.       mov   ah,0    ; read next keyboard character
  54.       int   16h
  55.  
  56.       mov   ah,15   ; get video mode
  57.       int   10h
  58.       mov   ah,0    ; set video mode (clears screen)
  59.       int   10h
  60.  
  61.       int   19h     ; re-boot
  62.  
  63. beg_message:
  64.       db    0Dh,0Ah ; return carriage, line-feed
  65.       db    0Dh,0Ah
  66.       db    0Dh,0Ah
  67.       db    0Dh,0Ah
  68.       db    '     Start your computer with'
  69.       db    0Dh,0Ah
  70.       db    '     a DOS system diskette.'
  71.       db    0Dh,0Ah
  72.       db    0Dh,0Ah
  73.       db    0Dh,0Ah
  74.       db    '     This is'
  75.       db    0Dh,0Ah
  76.       db    '         The Norton Utilities'
  77.       db    0Dh,0Ah
  78.       db    '             Version 3.10    '
  79.       db    0Dh,0Ah
  80.       db    0Dh,0Ah
  81.       db    '     from'
  82.       db    0Dh,0Ah
  83.       db    '         Peter Norton'
  84.       db    0Dh,0Ah
  85.       db    '         2210 Wilshire Blvd'
  86.       db    0Dh,0Ah
  87.       db    '         Santa Monica, CA 90403'
  88.       db    0Dh,0Ah
  89.       db    0Dh,0Ah
  90.       db    '           (213) 826-8032'
  91.       db    0Dh,0Ah
  92.       db    0Dh,0Ah
  93.       db    0Dh,0Ah
  94.       db    0Dh,0Ah
  95.       db    '    Insert a DOS diskette'
  96.       db    0Dh,0Ah
  97.       db    '    press any key to start DOS... '
  98. end_message:
  99.  
  100. ; I put a copyright notice here; you do if you want to
  101.  
  102. tail:
  103.  
  104. message_offset equ beg_message - head
  105. message_length equ end_message - beg_message
  106. filler_amount  equ 512 - (tail - head) - 2
  107.  
  108.       db    filler_amount dup (0) ; filler
  109.  
  110.       db    055h,0AAh             ; boot id
  111.  
  112. boot  endp
  113.  
  114. boots ends
  115.  
  116.       end head
  117.  
  118.  
  119.  
  120.