home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
ZCPR33
/
S-Z
/
SHOW14.LBR
/
SHOWPATH.ZZ0
/
SHOWPATH.Z80
Wrap
Text File
|
1988-03-07
|
3KB
|
156 lines
; SHOWPATH.Z80
pdisp:
call banner
call gxymsg
defb 3,31
defb highon,' Path Expressions ',highoff,0
call getpath ; Get pointer to path
ld a,(hl) ; See if path is empty
or a
jr nz,pdisp1
call gxymsg
defb 8,33
defb 'Path is Empty',0
jp getcmd
pdisp1:
call gxymsg
defb 6,17
defb highon,' Symbolic Form ',highoff,0
call gxymsg
defb 6,35
defb highon,' DU Form ',highoff,0
call gxymsg
defb 6,50
defb highon,' DIR Form ',highoff,0
; Display the symbolic path elements
symdisp:
ld hl,8*100h+23 ; Set up cursor
ld (infoxy),hl
call getpath ; Set up pointer to path
symdisp1:
ld a,(hl) ; Check for end of path
or a
jr z,dudisp ; If end, go on to display DU form
call dispxy ; Position cursor
call dispxy ; Skip extra line
ld a,(hl) ; Get drive
cp '$' ; Current drive specifier?
jr z,symdisp2 ; If so, skip
add a,'A'-1 ; Else, convert to letter
symdisp2:
call cout ; Display drive letter
inc hl ; Point to user
ld a,(hl) ; Get user number
cp '$' ; Current?
jr nz,symdisp3 ; If not, skip
call cout ; If so, display current indicator
jr symdisp4 ; ..and skip ahead
symdisp3:
call pafdc ; Display user number
symdisp4:
inc hl ; Point to next element in path
jr symdisp1
; Dispay DU form of path
dudisp:
ld hl,8*100h+38 ; Set up cursor
ld (infoxy),hl
call retud ; Get current user/drive into BC
inc b ; Shift drive to range 1..16
call getpath ; Set up pointer to path in HL
dudisp1:
ld a,(hl) ; Check for end of path
or a
jr z,dirdisp ; If so, go on to DIR display
call dispxy
call dispxy
ld a,(hl) ; Get drive
cp '$' ; Current?
jr nz,dudisp2 ; If not, skip ahead
ld a,b ; Else substitute current drive
dudisp2:
add a,'A'-1 ; Convert to letter
call cout ; Display the drive
inc hl ; Point to user
ld a,(hl) ; Get user
cp '$' ; Current?
jr nz,dudisp3 ; If not, skip
ld a,c ; Else substitute current user
dudisp3:
call pafdc ; Display user number
inc hl ; Point to next path element
jr dudisp1
; Dispay DIR form of path
dirdisp:
ld hl,8*100h+52 ; Set up cursor
ld (infoxy),hl
call getpath ; Set up pointer to path in HL
dirdisp1:
ld a,(hl) ; Get drive
or a ; Done?
jp z,getcmd ; If so, get next SHOW command
call dispxy
call dispxy
call retud ; Get current user/drive into BC
ld a,(hl) ; Get drive
cp '$' ; Current?
jr z,dirdisp2 ; If so, skip ahead
ld b,a ; Else replace with specified drive
dec b ; Adjusted to range 0..15
dirdisp2:
inc hl ; Point to user
ld a,(hl) ; Get user
cp '$' ; Current?
jr z,dirdisp3 ; If so, skip
ld c,a ; Else replace with specified user
dirdisp3:
push hl ; Save pointer to path
call prtdir ; Display the named directory
pop hl
inc hl ; Point to next path element
jr dirdisp1
;----------------------------------------
; Subroutine to convert DU in register BC into a named directory and to display
; it. If there is no corresponding name, 'noname' is displayed instead.
prtdir:
call dutdir ; Convert to name
jr z,prtdir2 ; Skip if no corresponding name
ld b,8 ; Eight characters max
prtdir1:
ld a,(hl) ; Get name character
call cout ; Display it
inc hl ; Point to next
djnz prtdir1 ; Loop through them
ret
prtdir2:
call vprint
defb 'noname',0
ret
; End SHOWPATH.Z80