[Table of Contents]
The ADDDEV.I include file resides on the Kyan Pascal 2.x Utilities Disk 1. It contains one procedure, ADD_DEVICE.
procedure add_device(var instr,outstr:pathstring);
begin
#a
ldy #5 ;pop the arguments
lda (_sp),y ;off of the stack
sta _t+2 ;and into zero
iny ;page memory.
lda (_sp),y
sta _t+3
iny
lda (_sp),y
sta _t
iny
lda (_sp),y
sta _t+1
ldy #0
aloop equ *
lda (_t),y ;read from IN
iny ;string and copy
iny ;3 places over
iny ;in OUT.
sta (_t+2),y
dey ;dec y twice
dey ;thus inc y once
cpy #$11 ;has a maxfile size been copied.
bne aloop ;no copy next char.
ldy #4
lda (_t+2),y ;check for fullpath
cmp #':
beq fullp
iny
lda (_t+2),y
cmp #':
beq fullp
ldy #02 ;add device
bloop equ *
lda $487,y
sta (_t+2),y
dey
bpl bloop
jmp leave
fullp equ * ;full path just normalize.
ldy #$ff
cloop equ *
iny
iny
iny
iny
lda (_t+2),y
dey
dey
dey
sta (_t+2),y
cpy #$10
bne cloop
leave equ * ;capitalize 1st letter.
ldy #0
lda (_t+2),y
and #$df
sta (_t+2),y
#
end;
No comments:
Post a Comment