  "osfile"[OPT Pass%.OsArgs  \ Return file system no.   Cpy #0   Bne args2   Cmp #0$   Bne next_args.   Lda #our_fs_no8
   RtsB.next_argsL   Cmp #1V   Bne args2`   Lda clinej   Sta &0,Xt   Lda cline+1~   Sta &1,X   Lda #0   Sta &2,X   Sta &3,X   Lda #1
   Rts
.args2   Cpy #2   Bne args3
   Pha;   Lda #05  \ **************** File length !!!!!!!!!!!!   Sta &0,X   Lda #0    Sta &1,X
   Sta &2,X   Sta &2,X
   Pla(
.args32
   Rts< F.attributesP!   Lda zp0: Pha: Lda zp1: PhaZ   Ldy #0: Lda (zp0),Y: Taxd    Iny: Lda (zp0),Y: Sta zp1n   Stx zp0x-   \ zp0,1 now points to file name string   Ldy #("F")>   Jsr transact   \ zp0,1 should point to string !!!!!!!!!   Pla: Sta zp1   Pla: Sta zp0   Jsr verify2   Jsr GetLoadAddr \ reads 16 bytes, reads esc.sneaky_fixup   Ldy #2
.attr1+   Lda info_block-2+4,Y    \ load, exec   Sta (zp0),Y
   Iny   Cpy #8+2   Bne attr1
.attr2"   lda info_block-2-8,Y  \ len"   Sta (zp0),Y,
   Iny6   Cpy #12+2@   Bne attr2J
.attr3T#   Lda info_block-2,Y  \ attr  ^   Sta (zp0),Yh
   Inyr   Cpy #16+2|   Bne attr3   Ldx zp0   Ldy zp1   Lda #1
   Rts .GetLoadAddr   \ Expect 16 bytes in hex0   \ Store in private workspace (info_block)   Lda #0   Sta work1.next_info   Jsr GetHex   Ldy work1   Sta info_block,Y   Inc work1   Cpy #15&   Bne next_info0   Jsr verify:
   RtsD N.starloadX1   \ zp 0,1 point to control block for OSFILEb   Ldy #6l   Lda (zp0),Yv   Beq use_CB   Jsr dobrk/   EQUB &FF: EQUS "No load address": EQUB 0.use_CB!   Lda zp0: Pha: Lda zp1: Pha   Ldy #0: Lda (zp0),Y: Tax    Iny: Lda (zp0),Y: Sta zp1   Stx zp0-   \ zp0,1 now points to file name string   Ldy #("L")   Jsr transact   Jsr verify   Jsr GetLoadAddr   Lda #27   Jsr SendCom   Pla: Sta zp1   Pla: Sta zp0 &   \ zp 0,1 now ppoint at CB again*   Lda #24
   Clc>$   Adc zp0  \ Load address blockH   Sta scratch0R   Lda zp1\   Adc #0f   Sta scratch1p   Jsr initloadz   Ldy #0   Lda (scratch0),Y
   Pha
   Iny   Lda (scratch0),Y   Sta scratch1
   Pla   Sta scratch0\   Lda scratch1:\ PhaD\   Lda scratch0:\ Pha  \ Save start addr for working out length.load_loop   Jsr GetHex   Bcs load_done   Jsr putbyte	   Inc scratch0	   BNE ncy2	   Inc scratch1	$	.ncy2	.   Jmp load_loop	8.load_done	B   Jsr reltub	L   Jsr sneaky_fixup	V\   Ldy #&0A	`\   Pla:\ Sta work1	jC\   Lda scratch0:\ Sec:\ Sbc work1   \ Might be a byte too long	t\   Sta (zp0),Y  \ Y<-&A	~\   Pla:\ Sta work1	 \   Lda scratch1:\ Sbc work1	\   Iny	\   Sta (zp0),Y  \ Y<-&B	\   Iny	\   Lda #0	\   Sta (zp0),Y	\   Iny	\   Sta (zp0),Y	$   Lda #1  \ type code for file.	   Ldx zp0	   Ldy zp1	
   Rts
 .starsave

1   \ zp 0,1 point to control block for OSFILE
!   Lda zp0: Pha: Lda zp1: Pha
   Ldy #0: Lda (zp0),Y: Tax
(    Iny: Lda (zp0),Y: Sta zp1
2   Stx zp0
<-   \ zp0,1 now points to file name string
F   Ldy #("S")
P   Jsr transact
Z  Jsr verify
d  Pla: Sta zp1
n1   Pla: Sta zp0 \zp 0,1 now point to CB again
x   Lda #&0A

   Clc
   Adc zp0
   Sta scratch0
   Lda zp1
   Adc #0
   Sta scratch1
   Jsr initsave
   Ldy #0
   Lda (scratch0),Y

   Pha

   Iny
   Lda (scratch0),Y
   Sta scratch1
   Pla   Sta scratch0   Lda #0"   Sta work3,.next_save6   Ldy #&0E: Lda (zp0),Y@   Cmp scratch0J   bne notendT   Iny: Lda (zp0),Y^   Cmp scratch1h   bne notendr   Jmp save_done|.notend   Jsr getbyte
   Pha   Lsr A:Lsr A:Lsr A:Lsr A   CLC: ADC #("0")   Jsr SendCom
   Pla   And #&0F   CLC: ADC #("0")   Jsr SendCom   Inc scratch0   BNE ncy3   inc scratch1	.ncy3   Inc work3   Lda work3:And #15:Tay   Bne next_save   Jsr verify&   Jmp next_save0.save_done:   Jsr reltubD   Lda #27: jsr SendComN   jsr verifyX   Ldx zp0b   ldy zp1l   Lda #0v
   rts]