home *** CD-ROM | disk | FTP | other *** search
/ Syzygy Magazine 7 / Syzygy_Magazine_7_1999___pl_Disk_2_of_2_Side_B.atr / ciolib.arc / CIOLIB.MAE < prev   
Text File  |  2000-01-27  |  2KB  |  1 lines

  1. ; I/O library¢; Lastchanges: 30.11.1999¢; Lizard/BBSL¢¢; Openfile¢; In:AY- pointer to filename¢;X- mode¢; Out:X- channel * 16¢f.open¢stx$15¢jsr_lookup¢lda$15¢sta$034a,x¢lda#$03¢jsr_cio¢bmi?e¢jsr_tag¢ldy$0343,x¢?erts¢¢; Close file¢; In:X- channel * 16¢f.close¢jsr_tag¢lda#$0c¢_ciosta$0342,x¢jmp$e456¢¢; Cloase all channels¢f.closeall¢ldy#$07¢?lldaf.htab,y¢beq?s¢sty?r+1¢tya¢asl¢asl¢asl¢asl¢tax¢jsrf.close¢?rldy#$00¢?sdey¢bpl?l¢rts¢¢; Rename; Remove; Lock; Unlock file¢; In:AY- pointer to filenames¢; Out:X- closed channel * 16¢rename¢ldx#$00¢.he2c¢remove¢ldx#$01¢.he2c¢f.lock¢ldx#$03¢.he2c¢f.unlock¢ldx#$04¢pha¢txa¢ora#$20¢sta$15¢pla¢jsr_lookup¢lda$15¢bcc_cio¢¢; Readfrom file¢; In:AY- buffer¢;   ICBUFL- length¢;X- channel * 16¢f.read¢jsrf.sbufa¢lda#$07¢bne_cio¢¢; Write tofile¢; In:AY- buffer¢;   ICBUFL- length¢;X- channel * 16¢f.write¢jsrf.sbufa¢lda#$0b¢bne_cio¢¢; Get string¢; In:AY- buffer¢;X- length¢; Out:Y- string length¢gets¢pha¢tya¢pha¢txa; <length¢ldy#$00; >length¢ldx#$00; channel #0¢jsrf.sbufl¢pla¢tay¢pla¢¢; Get string from file¢; In:AY- buffer¢;   ICBUFL- length¢;X- channel * 16¢; Out:Y- string length (LSB)¢f.gets¢jsrf.sbufa¢lda#$05¢jsr_cio¢ldy$0348,x¢lda$0343,x¢rts¢¢; Put string to file¢; In:AY- buffer¢;X- channel * 16¢f.puts¢jsrf.sbufa¢lda#$ff¢tay¢jsrf.sbufl¢lda#09¢bne_cio¢¢; Get char¢; Out:A- byte¢getc¢ldx#$00¢¢; Get charfrom file¢; In:X- channel * 16¢; Out:A- byte¢f.getcjsr*+6¢cpy#$00¢rts¢ldy$0340,x¢lda$031b,y¢sta$15¢lda$031c,y¢sta$16¢ldy#$05¢lda($15),y¢pha¢dey¢lda($15),y¢pha¢rts¢¢; Put char¢; In:A- char¢; Out:A- send char¢putc¢ldx#$00¢¢; Put charto file¢; In:A- char¢;X- channel * 16¢; Out:A- send char¢f.putcjsr*+6¢cpy#$00¢rts¢tay¢lda$0347,x¢pha¢lda$0346,x¢pha¢tya¢rts¢¢; Filelookup¢; Out:C=1- all channels already open¢;X- channel * 16¢f.lookup¢clc¢lda#$00¢?ltax¢lda$0340,x¢bmi?e¢txa¢adc#$10¢bpl?l¢sec¢?erts¢¢_lookup¢pha¢jsrf.lookup¢pla¢bccf.sbufa¢pla¢pla¢ldy#$ff¢rts¢¢; Set filebuffer address¢; In:AY- pointer to buffer¢;X- channel * 16¢f.sbufa¢sta$0344,x¢tya¢sta$0345,x¢rts¢¢; Set filebuffer length¢; In:AY- buffer length¢;X- channel * 16¢f.sbufl¢sta$0348,x¢tya¢sta$0349,x¢rts¢¢_tagpha¢txa¢lsr¢lsr¢lsr¢lsr¢tay¢lda#$ff¢eorf.htab,y¢staf.htab,y¢pla¢rts¢¢f.htab.dc8 0¢