home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 207.lha / PopInfo / ReadBlock.asm < prev   
Assembly Source File  |  1996-02-14  |  1KB  |  48 lines

  1. ; This routine reads the bootblock of the disk and
  2. ; copies it into diskbuffer.
  3. ; This was "borrowed" from VirusX2.0 (The Complete Virus Removal
  4. ; System) © Copyright 1988 Steve Tibbett.. well I was all set to write
  5. ; my own and VirusX2.0 came my way, so I thought.. ah what the hell!
  6. ; Also "borrowed" was the routine that displays the bootblock on the screen
  7. ; but all this IS public domain, so.....
  8.  
  9.    xref _geta4
  10.    xref _diskreq
  11.    xref _diskbuffer
  12.    xref _LVODoIO
  13.    xdef _ReadBlock
  14.  
  15. _ReadBlock:
  16.    movem.l d1/a0/a1/a4/a5/a6,-(sp)
  17.    jsr _geta4
  18.  
  19.    move.l _diskreq,a0
  20.    move.w #2,$1c(a0)
  21.    lea _diskbuffer,a1
  22.    move.l a1,d0
  23.    move.l d0,$28(a0)
  24.    move.l #(3*512),$24(a0)
  25.    move.l #0,$2c(a0)
  26.    move.l 4,a6
  27.  
  28.    move.l _diskreq,a1
  29.    jsr _LVODoIO(a6)
  30.  
  31.    move.l _diskreq,a0
  32.    cmp.b #0,$1f(a0)
  33.    beq IsOkay
  34.  
  35. ReturnError:
  36.    move.l #0,d0
  37.    movem.l (sp)+,d1/a0/a1/a4/a5/a6
  38.    rts
  39.  
  40. IsOkay:
  41.    move.l _diskreq,a0
  42.    cmp.b #0,$1f(a0)
  43.    bne ReturnError
  44.  
  45.    move.l #1,d0
  46.    movem.l (sp)+,d1/a0/a1/a4/a5/a6
  47.    rts
  48.