BSAVE.I

[Table of Contents]

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


  • function BSAVE

Source Code


function bsave(var pathname:pathstring; len,dest:integer):integer;
    var
        source:pathstring;
    begin
    bsave:=0;
    add_device(pathname,source);
#a
 stx bssave
 ldx #$10         ;iocb1
bsopn1 lda $340,x ;ichid,x
 cmp #$ff
 beq bsopn2
 txa
 clc
 adc #$10
 tax
 cpx #$80
 bne bsopn1
 lda #$81
 ldy #25
 sta (_sp),y
 jmp bserr
bssave db 0
 ;open it
bsopn2 lda #3
 sta $342,x
 clc
 lda _sp
 adc #5
 sta $344,x
 lda #0
 adc _sp+1
 sta $345,x
 lda #8
 sta $34a,x  ;set aux1
 lda #0
 sta $34b,x  ;set aux2
 jsr $e456
 bpl *+5
 jmp bseave

 ;perform the read
 lda #$0b
 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
bseave tya
 ldy #25
 sta (_sp),y
 lda #$c
 sta $342,x
 jsr $e456
bserr equ *
 ldx bssave
#
end;

No comments:

Post a Comment