home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / LEDGERS / LEDG_05.MSA / SOURCE / HIGHLAND.ER / MAKEBOOT.S next >
Text File  |  1987-04-22  |  3KB  |  115 lines

  1. *-------------------------------------------------------------------------*
  2. * Create executable bootsector's onto DRIVE A..
  3. *-------------------------------------------------------------------------*
  4. * Coded by the Highlander in November 91.
  5. *-------------------------------------------------------------------------*
  6. * Please be warned that I accept no responsibility if you fuck up any of
  7. * your disks with this program!
  8. *-------------------------------------------------------------------------*
  9.  
  10. ;TEST            ; have this un-commented to just run boot sector
  11.             ; and not install it on the disk
  12.  
  13. *-------------------------------------------------------------------------*
  14.  
  15. GET:        clr.l    -(sp)
  16.         move.w    #$20,-(sp)
  17.         trap    #1
  18.         addq.l    #6,sp
  19.  
  20.         IFD    TEST
  21.         move.w    #0,-(sp)    ; go low rez
  22.         move.l    #-1,-(sp)
  23.         move.l    #-1,-(sp)
  24.         move.w    #5,-(sp)
  25.         trap    #14
  26.         lea.l    12(sp),sp
  27.         bsr    BOOTSECTOR    ; run bootsector
  28.         ELSE
  29. LD:        move.w    #1,-(sp)    ; load existing boot sector
  30.         move.w    #0,-(sp)
  31.         move.w    #0,-(sp)
  32.         move.w    #1,-(sp)
  33.         move.w    #0,-(sp)
  34.         clr.l    -(sp)
  35.         move.l    #BT,-(sp)
  36.         move.w    #8,-(sp)
  37.         trap    #14
  38.         lea.l    20(sp),sp
  39.         lea    CODE,a0
  40.         lea    BT+$3a,a1
  41.         move.w    #((512-$3a)/4)-1,d0
  42. .copy:        move.l    (a0)+,(a1)+        ; copy new boot
  43.         dbra    d0,.copy        ; over.
  44.         move.w    BOOTSECTOR,BT
  45.  
  46.         lea.l    BT,a0
  47.         move.w    #(512/2)-2,d7
  48.         moveq    #0,d0
  49. .ADD:        add.w    (a0)+,d0
  50.         dbra    d7,.ADD    
  51.         move.w    #$1234,d1
  52.         sub.w    d0,d1
  53.         move.w    d1,BT+$1fe        ; make checksum correct.
  54.  
  55. SAVE:        move.w    #1,-(sp)        ; save new boot sector.
  56.         move.w    #0,-(sp)
  57.         move.w    #0,-(sp)
  58.         move.w    #1,-(sp)
  59.         move.w    #0,-(sp)
  60.         clr.l    -(sp)
  61.         move.l    #BT,-(sp)
  62.         move.w    #9,-(sp)
  63.         trap    #14
  64.         lea.l    20(sp),sp
  65.         ENDC
  66.         move.w    #$777,$fff8240
  67.         clr.w    $fff8240+30
  68.         clr.w    -(sp)
  69.         trap    #1
  70.  
  71. BT:        ds.l    512/4
  72.  
  73. BOOTSECTOR:    bra.s    CODE
  74.         ds.b    $38
  75.  
  76. *-------------------------------------------------------------------------*
  77. * OKAY FROM HERE ON IN, YOU CAN PUT YOUR OWN CODE ALL 454 BYTES.
  78. * Remember to make sure all code is fully address independent.
  79. *-------------------------------------------------------------------------*
  80. * What is here at the moment is a simple screen fade.
  81. * Which afterwards displays a virus all clear message,
  82. * before exiting.
  83. *-------------------------------------------------------------------------*
  84.     
  85. CODE:        lea    $fff8242,a0
  86.         moveq    #0,d0
  87.         move.w    #$777,d7
  88.         move.w    d7,$fff8240    ; colour 0 = white
  89.         move.w    d7,$fff8240+30    ; colour 15 also = white
  90. .FADE:        moveq.w    #3,d6
  91. .FADE2:        move.w    #37,-(sp)
  92.         trap    #14
  93.         addq.w    #2,sp
  94.         dbra    d6,.FADE2
  95.         sub.w    #$111,d7
  96.         bmi.s    .END
  97.         move.w    d7,$fff8240
  98.         bra.s    .FADE
  99. .END:        pea    TEXT(PC)
  100.         move.w    #9,-(sp)    ; display text
  101.         trap    #1
  102.         addq.l    #6,sp
  103.         moveq    #30,d6        ; hold screen for while.
  104. .WT1:        move.w    #-1,d7
  105. .WT2:        dbra    d7,.WT2
  106.         dbra    d6,.WT1
  107.         rts            ; exit boot sector.
  108.  
  109. TEXT:        dc.b    27,"E"        ; clear screen
  110.         dc.b    "THE HIGHLANDER OF TPT AND THE ENTERPRISE",10,13
  111.         dc.b    "========================================",10,13
  112.         dc.b    10,13
  113.         dc.b    "FIND'S NO VIRUS ON THIS BOOTSECTOR!!!!!!",10,13
  114.         dc.b    0
  115.