include 'gsos.equ' include 'minix.equ' include 'records.equ' include 'fst.equ' include 'fst.macros' include 'M16.Debug' ; ; VolumeGS / Volume call. ; ; check if the disk is ours. create a VCR or mark it active. ; import id_disk my_dp record dp.__end src ds.l 1 dest ds.l 1 length ds.w 1 IF *>=$d4 THEN AERROR 'dp -- too large.' ENDIF endr import do_file_sys_id import do_ignore entry do_block_size entry do_free_blocks entry do_total_blocks entry do_vol_name_0 entry do_vol_name_1 volume procname export with dp with dev_parms with fst_parms stz tool_error lda fst_parms.dev1_num ; if no device, find a volume by name... beq no_dev jsr id_disk bcc got_it cmp #dup_volume beq dup sec rtl dup ; this is a duplicate volume. ; return the name (and only the name), but also return the error. lda 16 chars? see HFS. with fst_parms with dp, my_dp ; length and src are valid. lda [param_blk_ptr],y sta dest iny iny lda [param_blk_ptr],y sta dest+2 ; length should be in the range of 1-30. short m lda length sta [dest] long m lda dest clc adc #1 sta dest lda dest+2 adc #0 sta dest+2 short m ldy length dey beq done bmi exit8 ; should never happen. @loop lda [src],y sta [dest],y dey bne @loop done ; uses / as a separator lda #'/' sta [dest] exit8 long m clc rts endp do_vol_name_1 procname with fst_parms with dp, my_dp lda [param_blk_ptr],y sta dest iny iny lda [param_blk_ptr],y sta dest+2 ; check the length. lda [dest] sec sbc #4 bmi error cmp length ; branch after length stored... lda length ldy #2 sta [dest],y ; carry still set from cmp bcc error lda #4 clc adc dest sta dest lda #0 adc dest+2 sta dest+2 ldy length beq done dey short m @loop lda [src],y sta [dest],y dey bpl @loop long m done clc rts error lda #buff_too_small sta tool_error sec rts endp end