; LOAD.S - *LOAD command using blocked tape save ; J.G.Harston, 25 June 1986 ; Syntax: *LOAD filename ; Block header: ; 00 ; File type ; Filename ; Block length - 256 for full block, <256 for last block ; Block start address ; Block extra address ; ; Block data ; FF ; as per length ORG #5B00 LOAD LD HL,HEADER1+1 ; Point to filename LD B,10 NAME LD A,(DE) ; Copy filename from DE CP 33 JR C,NAMEPAD LD (HL),A INC HL INC DE DJNZ NAME JR NAMEOK NAMEPAD LD A,32 ; Pad with spaces LD (HL),A INC HL DJNZ NAMEPAD NAMEOK LD A,3 LD (HEADER1),A ; Set filetype LD_LOOP LD HL,0 ; Use file's start address LD (HEADER1+11),HL ; Use file's length LD IX,HEADER1 ; Point to header to search for CALL #0761 ; Load a block LD A,(HEADER2+12) ; Get length high byte AND A ; Last block has <256 bytes RET Z ; No more to load LD B,64 ; 64 characters LD_UP LD A,8 ; CHR$8 - move back RST #10 ; Move up a line to overwrite DJNZ LD_UP JR LD_LOOP ; Loop until last block loaded START EQU $ ; Data start LENGTH EQU START+2 ; Data length HEADER1 EQU START+4 ; File header to save/load HEADER2 EQU START+4+17 ; Loaded file header DEFW LOAD,LOAD