Standard loading routine for D80/D40 Disk drive systems.
Made especially for our Eastern Brothers

LOAD
----

:load di
      rst 0 - perfroms paging to D80 DRAM
             (now we are in d80 dram - zx rom is disconnected)
:cont call 7311 - read format and directory
      ld hl,name - pointer to filename
      ld de,16010 - and ldir it to DRAM
      ld bc,11 - 10name+1ext (B,P)
      ldir - im2 :))))
      call 8491 - find file on disk (nz=not found)
      jr nz,error
      ld (15986), hl - uses the system, it returns an adress of
                  the file entry in directory.
      push hl -  for next operation
      pop ix - hl>>ix
      ld e,(ix+11)
      ld d,(ix+12) - now the length is in DE-reg.
      ld ix,16384 - begin address (where to load)
      call 6574 - main load routine
      ld a,79
      ld (16119),a - for correct return from D80 DRAM!!!
      call 737 - stop motors and return to ZX ROM
     --------------------------------------------
     737 - call 9526 - stop motors
           jp 5888   - return to ZX ROM


:error  call 9526 - stop motors
:error2 ld a,127
        in a,(254)
        rra
        jr c,error2
        jr cont
 
:name defm "screen" -6bytes of name (for example)
      defb 0,0,0,0 - rest 4 bytes must be 0
      defb "B" - extension


Note:If you want to call this routine and return to BASIC, then
before each RANDOMIZE USR must be POKE #247,79 (similar to 16119,79)!!!
Otherwise, it will crash.
Back to the main index