Mercurial > hg > Members > kono > nitros9-code
changeset 689:92b575ffa143
Folded pxd.asm and pwd.asm into pd.asm for simplicity since almost all code
was common, modified Makefile
author | boisy |
---|---|
date | Mon, 30 Dec 2002 03:36:33 +0000 |
parents | 731312e5926c |
children | 7b42af4e85c2 |
files | level1/cmds/format.asm level1/cmds/makefile level1/cmds/pd.asm level1/cmds/pwd.asm level1/cmds/pxd.asm |
diffstat | 5 files changed, 221 insertions(+), 360 deletions(-) [+] |
line wrap: on
line diff
--- a/level1/cmds/format.asm Mon Dec 30 03:36:09 2002 +0000 +++ b/level1/cmds/format.asm Mon Dec 30 03:36:33 2002 +0000 @@ -205,12 +205,12 @@ start stu <SavedU bsr ClrWork cleark work area bsr OpenDev get device name and open it - bsr L011A + bsr Default lbsr GetDTyp - lbsr L03C7 - lbsr L052F - lbsr L0612 - lbsr L0648 + lbsr Format + lbsr InitDisk + lbsr Access + lbsr Stamps lbsr L0843 ldu <DTEntry os9 I$Detach @@ -219,18 +219,18 @@ ClrWork leay DiskPath,u pshs y leay >u00B7,u -L00C6 clr ,-y +ClrOne clr ,-y cmpy ,s - bhi L00C6 + bhi ClrOne puls pc,y -OpenDev lda ,x+ - cmpa #PDELIM - beq L00DA -L00D5 ldb #E$BPNam - lbra L0961 -L00DA os9 F$PrsNam - lbcs L0961 +OpenDev lda ,x+ get char at X + cmpa #PDELIM pathlist delimiter? + beq L00DA branch if so +L00D5 ldb #E$BPNam else set bad pathname + lbra L0961 and print error +L00DA os9 F$PrsNam parse pathname + lbcs L0961 branch if illegal (has additional pathlist element) lda #PDELIM cmpa ,y beq L00D5 @@ -258,7 +258,7 @@ sta <DiskPath rts -L011A bsr GetOpts +Default bsr GetOpts bsr L0183 lbsr L025E rts @@ -622,7 +622,8 @@ L03C2 lsr $02,s bne L03AE rts -L03C7 tst <u004E + +Format tst <u004E bne L03E4 tst <DType bpl L03E5 @@ -633,7 +634,7 @@ cmpa #'Y beq L03E5 cmpa #'N - bne L03C7 + bne Format L03E4 rts L03E5 lda <DiskPath ldb #SS.Reset @@ -787,7 +788,7 @@ leax $01,x stx $02,s bra L050F -L052F lbsr L0898 +InitDisk lbsr L0898 ldd <u0025 std $01,x ldb <u0024 @@ -877,7 +878,7 @@ lbcs L00BB leax >u00B7,u lbra L08A4 -L0612 lda <DiskPath +Access lda <DiskPath os9 I$Close leax <u004F,u lda #READ. @@ -896,7 +897,7 @@ lbcs L06F5 sta <DiskPath rts -L0648 lda <DType +Stamps lda <DType clr <u0045 bita #$80 beq L0667
--- a/level1/cmds/makefile Mon Dec 30 03:36:09 2002 +0000 +++ b/level1/cmds/makefile Mon Dec 30 03:36:33 2002 +0000 @@ -16,6 +16,12 @@ all: $(ALLOBJS) $(CHMOD) 755 $(ALLOBJS) +pwd: pd.asm + $(AS) $(AFLAGS) $< $(ASOUT)$@ -aPWD=1 + +pxd: pd.asm + $(AS) $(AFLAGS) $< $(ASOUT)$@ -aPXD=1 + clean: $(RM) $(ALLOBJS) $(BASIC09FILES)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level1/cmds/pd.asm Mon Dec 30 03:36:33 2002 +0000 @@ -0,0 +1,194 @@ +******************************************************************** +* p[wx]d - Print work/execution directory +* +* $Id$ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 From Tandy OS-9 Level One VR 02.00.00 + + nam p[wx]d + ttl Print work/execution directory + +* Disassembled 98/09/10 23:50:10 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + use rbfdefs + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 1 + + mod eom,name,tylg,atrv,start,size + +fildes rmb 1 +bufptr rmb 2 +DotDotFD rmb 3 +DotFD rmb 3 +DDCopy rmb 5 +dentry rmb 160 +buffer rmb 1 +sttbuf rmb 282 +size equ . + + IFNE PXD +name fcs /pxd/ + ELSE + IFNE PWD +name fcs /pwd/ + ENDC + ENDC + fcb edition + + IFNE PXD +badnam fcc "pxd: bad name in path" + ELSE + IFNE PWD +badnam fcc "pwd: bad name in path" + ENDC + ENDC + fcb C$CR +dotdot fcc "." +dot fcc "." +cr fcb C$CR +rdmsg fcc "read error" + fcb C$CR + +start leax >buffer,u + lda #C$CR + sta ,x + stx <bufptr + leax >dot,pcr + bsr open + sta <fildes + lbsr rdtwo + ldd <DotDotFD + std <DDCopy + lda <DotDotFD+2 + sta <DDCopy+2 +L0052 bsr L00C6 + beq L0079 + leax >dotdot,pcr + bsr chdir + lda <fildes + os9 I$Close + bcs L008D + leax >dot,pcr + bsr open + bsr rdtwo + bsr L00A8 + bsr L00E2 + ldd <DotDotFD + std <DDCopy + lda <DotDotFD+2 + sta <DDCopy+2 + bra L0052 +L0079 lbsr L00FB + ldx <bufptr + ldy #$0081 + lda #$01 + os9 I$WritLn + lda <fildes + os9 I$Close + clrb +L008D os9 F$Exit + IFNE PXD +chdir lda #DIR.+EXEC.+READ. + ELSE + IFNE PWD +chdir lda #DIR.+READ. + ENDC + ENDC + os9 I$ChgDir + rts + IFNE PXD +open lda #DIR.+EXEC.+READ. + ELSE + IFNE PWD +open lda #DIR.+READ. + ENDC + ENDC + os9 I$Open + rts + +read32 lda <fildes + leax dentry,u + ldy #DIR.SZ + os9 I$Read + rts + +L00A8 lda <fildes + bsr read32 + bcs L010F + leax dentry,u + leax <DIR.FD,x + leay DDCopy,u + bsr attop + bne L00A8 + rts + +attop ldd ,x++ + cmpd ,y++ + bne L00C5 + lda ,x + cmpa ,y +L00C5 rts + +L00C6 leax DotDotFD,u + leay DotFD,u + bsr attop * check if we're at the top + rts + +rdtwo bsr read32 * read "." from directory + ldd <dentry+DIR.FD + std <DotFD + lda <dentry+DIR.FD+2 + sta <DotFD+2 + bsr read32 * read ".." from directory + ldd <dentry+DIR.FD + std <DotDotFD + lda <dentry+DIR.FD+2 + sta <DotDotFD+2 + rts + +L00E2 leax dentry,u +prsnam os9 F$PrsNam + bcs L0109 + ldx <bufptr +L00EB lda ,-y + anda #$7F + sta ,-x + decb + bne L00EB + lda #PDELIM + sta ,-x + stx <bufptr + rts +L00FB lda <fildes + ldb #SS.DevNm + leax >sttbuf,u + os9 I$GetStt + bsr prsnam + rts +L0109 leax >badnam,pcr + bra wrerr +L010F leax >rdmsg,pcr + bra wrerr +L0115 lda #$02 + os9 I$Write + bcs L0128 + rts + bsr L0115 + leax >cr,pcr +wrerr lda #$02 + os9 I$WritLn +L0128 ldb #$00 + os9 F$Exit + + emod +eom equ * + end +
--- a/level1/cmds/pwd.asm Mon Dec 30 03:36:09 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -******************************************************************** -* pwd - Print working directory -* -* $Id$ -* -* Ed. Comments Who YY/MM/DD -* ------------------------------------------------------------------ -* 1 From Tandy OS-9 Level One VR 02.00.00 - - nam pwd - ttl Print working directory - -* Disassembled 98/09/10 23:50:10 by Disasm v1.6 (C) 1988 by RML - - ifp1 - use defsfile - use rbfdefs - endc - -tylg set Prgrm+Objct -atrv set ReEnt+rev -rev set $01 -edition set 1 - - mod eom,name,tylg,atrv,start,size - -fildes rmb 1 -bufptr rmb 2 -DotDotFD rmb 3 -DotFD rmb 3 -DDCopy rmb 5 -dentry rmb 160 -buffer rmb 1 -sttbuf rmb 282 -size equ . - -name fcs /pwd/ - fcb edition - -badnam fcc "pwd: bad name in path" - fcb C$CR -dotdot fcc "." -dot fcc "." -cr fcb C$CR -rdmsg fcc "read error" - fcb C$CR - -start leax >buffer,u - lda #C$CR - sta ,x - stx <bufptr - leax >dot,pcr - bsr open - sta <fildes - lbsr rdtwo - ldd <DotDotFD - std <DDCopy - lda <DotDotFD+2 - sta <DDCopy+2 -L0052 bsr L00C6 - beq L0079 - leax >dotdot,pcr - bsr chdir - lda <fildes - os9 I$Close - bcs L008D - leax >dot,pcr - bsr open - bsr rdtwo - bsr L00A8 - bsr L00E2 - ldd <DotDotFD - std <DDCopy - lda <DotDotFD+2 - sta <DDCopy+2 - bra L0052 -L0079 lbsr L00FB - ldx <bufptr - ldy #$0081 - lda #$01 - os9 I$WritLn - lda <fildes - os9 I$Close - clrb -L008D os9 F$Exit -chdir lda #DIR.+READ. - os9 I$ChgDir - rts -open lda #DIR.+READ. - os9 I$Open - rts - -read32 lda <fildes - leax dentry,u - ldy #DIR.SZ - os9 I$Read - rts - -L00A8 lda <fildes - bsr read32 - bcs L010F - leax dentry,u - leax <DIR.FD,x - leay DDCopy,u - bsr attop - bne L00A8 - rts - -attop ldd ,x++ - cmpd ,y++ - bne L00C5 - lda ,x - cmpa ,y -L00C5 rts - -L00C6 leax DotDotFD,u - leay DotFD,u - bsr attop * check if we're at the top - rts - -rdtwo bsr read32 * read "." from directory - ldd <dentry+DIR.FD - std <DotFD - lda <dentry+DIR.FD+2 - sta <DotFD+2 - bsr read32 * read ".." from directory - ldd <dentry+DIR.FD - std <DotDotFD - lda <dentry+DIR.FD+2 - sta <DotDotFD+2 - rts - -L00E2 leax dentry,u -prsnam os9 F$PrsNam - bcs L0109 - ldx <bufptr -L00EB lda ,-y - anda #$7F - sta ,-x - decb - bne L00EB - lda #PDELIM - sta ,-x - stx <bufptr - rts -L00FB lda <fildes - ldb #SS.DevNm - leax >sttbuf,u - os9 I$GetStt - bsr prsnam - rts -L0109 leax >badnam,pcr - bra wrerr -L010F leax >rdmsg,pcr - bra wrerr -L0115 lda #$02 - os9 I$Write - bcs L0128 - rts - bsr L0115 - leax >cr,pcr -wrerr lda #$02 - os9 I$WritLn -L0128 ldb #$00 - os9 F$Exit - - emod -eom equ * - end -
--- a/level1/cmds/pxd.asm Mon Dec 30 03:36:09 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -******************************************************************** -* pxd - Print execution directory -* -* $Id$ -* -* Ed. Comments Who YY/MM/DD -* ------------------------------------------------------------------ -* 1 From Tandy OS-9 Level One VR 02.00.00 - - nam pxd - ttl Print execution directory - -* Disassembled 98/09/10 23:50:10 by Disasm v1.6 (C) 1988 by RML - - ifp1 - use defsfile - use rbfdefs - endc - -tylg set Prgrm+Objct -atrv set ReEnt+rev -rev set $01 -edition set 1 - - mod eom,name,tylg,atrv,start,size - -fildes rmb 1 -bufptr rmb 2 -DotDotFD rmb 3 -DotFD rmb 3 -DDCopy rmb 5 -dentry rmb 160 -buffer rmb 1 -sttbuf rmb 282 -size equ . - -name fcs /pxd/ - fcb edition - -badnam fcc "pxd: bad name in path" - fcb C$CR -dotdot fcc "." -dot fcc "." -cr fcb C$CR -rdmsg fcc "read error" - fcb C$CR - -start leax >buffer,u - lda #C$CR - sta ,x - stx <bufptr - leax >dot,pcr - bsr open - sta <fildes - lbsr rdtwo - ldd <DotDotFD - std <DDCopy - lda <DotDotFD+2 - sta <DDCopy+2 -L0052 bsr L00C6 - beq L0079 - leax >dotdot,pcr - bsr chdir - lda <fildes - os9 I$Close - bcs L008D - leax >dot,pcr - bsr open - bsr rdtwo - bsr L00A8 - bsr L00E2 - ldd <DotDotFD - std <DDCopy - lda <DotDotFD+2 - sta <DDCopy+2 - bra L0052 -L0079 lbsr L00FB - ldx <bufptr - ldy #$0081 - lda #$01 - os9 I$WritLn - lda <fildes - os9 I$Close - clrb -L008D os9 F$Exit -chdir lda #DIR.+EXEC.+READ. - os9 I$ChgDir - rts -open lda #DIR.+EXEC.+READ. - os9 I$Open - rts - -read32 lda <fildes - leax dentry,u - ldy #DIR.SZ - os9 I$Read - rts - -L00A8 lda <fildes - bsr read32 - bcs L010F - leax dentry,u - leax <DIR.FD,x - leay DDCopy,u - bsr attop - bne L00A8 - rts - -attop ldd ,x++ - cmpd ,y++ - bne L00C5 - lda ,x - cmpa ,y -L00C5 rts - -L00C6 leax DotDotFD,u - leay DotFD,u - bsr attop * check if we're at the top - rts - -rdtwo bsr read32 * read "." from directory - ldd <dentry+DIR.FD - std <DotFD - lda <dentry+DIR.FD+2 - sta <DotFD+2 - bsr read32 * read ".." from directory - ldd <dentry+DIR.FD - std <DotDotFD - lda <dentry+DIR.FD+2 - sta <DotDotFD+2 - rts - -L00E2 leax dentry,u -prsnam os9 F$PrsNam - bcs L0109 - ldx <bufptr -L00EB lda ,-y - anda #$7F - sta ,-x - decb - bne L00EB - lda #PDELIM - sta ,-x - stx <bufptr - rts -L00FB lda <fildes - ldb #SS.DevNm - leax >sttbuf,u - os9 I$GetStt - bsr prsnam - rts -L0109 leax >badnam,pcr - bra wrerr -L010F leax >rdmsg,pcr - bra wrerr -L0115 lda #$02 - os9 I$Write - bcs L0128 - rts - bsr L0115 - leax >cr,pcr -wrerr lda #$02 - os9 I$WritLn -L0128 ldb #$00 - os9 F$Exit - - emod -eom equ * - end -