BLOAD.I

[Table of Contents]


The BLOAD.I include file resides on the Kyan Pascal 2.x Utilities Disk 1. It contains one function:


  • function BLOAD




function bload(var pathname:pathstring; len,dest:integer):integer;
    var
        source:pathstring;
    begin
    bload:=0;
    add_device(pathname,source);
    if len=0 then len:=maxint;
#a
 sta blsave
 ldx #$10         ;iocb1
blopn1 lda $340,x ;ichid,x
 cmp #$ff
 beq blopn2
 txa
 clc
 adc #$10
 tax
 cpx #$80
 bne blopn1
 ldy #25
 lda #$81
 sta (_sp),y
 jmp blerr
blsave db 0
 ;open it
blopn2 lda #3
 sta $342,x
 clc
 lda _sp
 adc #5
 sta $344,x
 lda #0
 adc _sp+1
 sta $345,x
 lda #4
 sta $34a,x  ;set aux1
 lda #0
 sta $34b,x  ;set aux2
 jsr $e456
 bpl *+5
 jmp bleave
 lda #7
 sta $342,x
 ldy #27
 lda (_sp),y
 sta $344,x
 iny
 lda (_sp),y
 sta $345,x
 iny
 lda (_sp),y
 sta $348,x
 iny
 lda (_sp),y
 sta $349,x
 jsr $e456
bleave tya
 ldy #25
 sta (_sp),y
 lda #$c
 sta $342,x
 jsr $e456
blerr equ *
 ldx blsave
#
end;

No comments:

Post a Comment