home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / DBOOTNEW.ZIP / BSTRAP.ASM next >
Assembly Source File  |  1984-08-31  |  1KB  |  43 lines

  1.     page    61,132
  2.     title    Bstrap - update fixed disk bootstrap
  3.     subttl    Code
  4.     page    +
  5. Code    segment
  6.     assume    cs:Code, ds:Code, es:Code, ss:Code
  7.     org    100h
  8. Bstrap    proc    far
  9.     mov    ax,201h             ; read 1 sector
  10.     lea    bx,Boot             ; buffer address
  11.     mov    cx,1                ; cyl 0, sector 1
  12.     mov    dx,80h                ; head 0, drive 0
  13.     int    13h                ; read fixed disk boot
  14.     jc    Exit                ; exit if error
  15.     push    bx                ; save bx
  16.     push    cx                ; save cx
  17.     push    dx                ; save dx
  18.     mov    dx,bx                ; address buffer
  19.     mov    cx,1beh             ; maximum boot length
  20.     sub    bx,bx                ; read from stdin
  21.     mov    ah,3fh                ; read from stream
  22.     int    21h                ; dos service
  23.     pop    dx                ; restore dx
  24.     pop    cx                ; restore cx
  25.     pop    bx                ; restore bx
  26.     jc    Exit                ; exit if error
  27.     mov    ax,301h             ; write 1 sector
  28.     int    13h                ; update boot record
  29.     jc    Exit                ; exit if error
  30.     mov    bx,2                ; write to stderr
  31.     mov    cx,Msgl             ; length of message
  32.     lea    dx,Msg                ; message address
  33.     mov    ah,40h                ; write to stream
  34.     int    21h                ; send message
  35. Exit:
  36.     int    20h                ; exit program
  37. Msg    db    13,10,'Boot record updated.',13,10
  38. Msgl    equ    $-Msg
  39. Boot    db    512 dup (?)
  40. Bstrap    endp
  41. Code    ends
  42.     end    Bstrap
  43.