home *** CD-ROM | disk | FTP | other *** search
/ CBM Funet Archive / cbm-funet-archive-2003.iso / cbm / documents / projects / drives / 64hdproj.sfx / rdboot.src < prev    next >
Encoding:
Text File  |  1990-02-12  |  1.0 KB  |  53 lines

  1. ;bput"readboot.src"
  2. ;rput"readboot.src"
  3. ;
  4. .lib hardjump.eq
  5. .lib hardiskz.eq
  6. ;
  7. * = $0840
  8. start jsr hdinit ;init ctl blocks
  9.  jsr reset ;issue the reset
  10.  bcs reseterror
  11.  lda #$80
  12.  ldy #$28 ;get number of sectors to read
  13.  ldx #$40 ;get sector number
  14.  jsr readit ;go convert and read
  15.  bcs readerror ;go if bad
  16.  lda #$e0 ;address input area
  17.  ldy #$10
  18.  ldx #$69
  19.  jsr readit
  20.  bcs readerror
  21.  jsr 52224
  22.  jmp $c000 ;end
  23. ;
  24. readit sta bufadr+1 ;address input
  25.  sty blkcnt ;# 512 byte blocks
  26.  stx secnum+2
  27.  lda #0
  28.  sta hdnum ;clear the drive number
  29.  sta secnum
  30.  sta secnum+1
  31.  jsr sec2cyldcb ;convert to disk addr
  32.  lda head ;fill the dcb
  33.  sta hdnum
  34.  lda cyllsb ;get low cyl addr
  35.  sta cylnum
  36.  lda cylmsb ;get hi cyl and sector
  37.  sta secadr ;put in dcb
  38.  jmp read ;read and return to caller
  39. ;
  40. reseterror ldx #0
  41.  .byt $2c ;
  42. readerror ldx #0
  43. readerrorl lda resetmsg,x
  44.  beq done
  45.  jsr $ffd2
  46.  inx
  47.  bne readerrorl
  48. done rts
  49.  brk
  50. ;
  51. resetmsg .byt 'reset failed',13,0
  52. readerrmsg .byt 'read failed',13,0
  53. .end
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.