Mercurial > hg > Members > kono > nitros9-code
view level1/cmds/attr.asm @ 15:0912ac5dc2ff
Added initial and dates to some source files
added mfree.asm, modified makefile
author | boisy |
---|---|
date | Fri, 05 Apr 2002 21:35:25 +0000 |
parents | 6641a883d6b0 |
children | 0d02be492d77 |
line wrap: on
line source
******************************************************************** * Attr - Modify file attributes * * $Id$ * * Ed. Comments Who YY/MM/DD * ------------------------------------------------------------------ * 8 Original Tandy distribution version nam Attr ttl Modify file attributes * Disassembled 98/09/11 11:44:51 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 8 mod eom,name,tylg,atrv,start,size fpath rmb 1 rawpath rmb 1 parmptr rmb 2 cmdperms rmb 2 u0006 rmb 1 u0007 rmb 1 pathopts rmb 20 u001C rmb 2 u001E rmb 1 u001F rmb 9 u0028 rmb 32 filename rmb 32 fdesc rmb 16 u0078 rmb 46 u00A6 rmb 414 size equ . name fcs /Attr/ fcb edition L0012 fcb C$LF fcc "Use: Attr <pathname> {[-]<opts>}" fcb C$LF fcc " opts: -d s r w e pr pw pe -a" fcb C$CR L0052 fcb C$LF fcc "You do not own that file." fcb C$CR L006D fcb C$LF fcc "Use Makdir to create a directory" fcb C$CR L008F fcb C$LF fcc "ERROR; the directory is not empty" fcb C$CR L00B2 fcc "dsewrewr" fcb $FF start stx <parmptr save param ptr clr <u0007 com <u0007 clra os9 I$Open open file on commandline bcc L00D9 branch if ok ldx <parmptr get saved param ptr lda #DIR.!READ. load perms os9 I$Open open as directory bcc L00D9 branch if ok ldx <parmptr get param ptr lda #DIR. load different perms os9 I$Open try one more time bcs L0114 branch if error L00D9 sta <fpath save off path stx <cmdperms save updated parm ptr leax pathopts,u point X to buffer ldb #SS.Opt load with status code os9 I$GetStt get status bcs L0114 branch if error clrb lda ,x get path type cmpa #DT.RBF check if rbf path lbne L01AC branch if not ldx <parmptr else get parm ptr leay <filename,u point to buffer lda ,x+ get file name character cmpa #PDELIM path delimiter? bne L0106 no L00FA sta ,y+ else save char in Y lda ,x+ get next file name char cmpa #C$PERD period? bcs L0106 branch if not cmpa #PDELIM path delimiter? bne L00FA branch if not L0106 lda #'@ ldb #C$SPAC std ,y++ leax <filename,u point X to filename lda #READ.!WRITE. load perms os9 I$Open open in raw mode L0114 lbcs L01AC branch if error sta <rawpath lda <fpath clr <u001F,u pshs u ldx <u001C,u get MS 16 bits ldu <u001E,u get LS 16 bits lda <rawpath get path os9 I$Seek seek puls u bcs L01AC branch if error leax <fdesc,u point to buffer ldy #FD.SEG os9 I$Read bcs L01AC os9 F$ID get ID cmpy #$0000 super user? beq L014B branch if so cmpy <fdesc+FD.OWN,u is user same as file's owner? bne L01C1 branch if not L014B ldx <cmdperms point to perms on cmd line lbsr L021D bcs L018B L0152 lbsr L021D bcc L0152 clrb lda ,x cmpa #$0D bne L01AC pshs u ldx <u001C,u ldu <u001E,u lda <rawpath os9 I$Seek seek puls u bcs L01AC branch if error leax <fdesc,u point to file desc ldy #1 only 1 byte os9 I$Write write out new attributes bcs L01AC branch if error os9 I$Close close file bcs L01AC branch if error lda <fpath get file path os9 I$Close close file bcs L01AC branch if error ldb <u0007 beq L01BE L018B ldb <fdesc,u get attribute leax >L00B2,pcr leay <u0078,u lda ,x+ L0197 lslb bcs L019C lda #'- L019C sta ,y+ lda ,x+ bpl L0197 lda #C$CR sta ,y+ leax <u0078,u clrb bra L01B0 L01AC leax >L0012,pcr L01B0 pshs b lda #2 ldy #256 os9 I$WritLn comb puls b L01BE os9 F$Exit L01C1 clrb leax >L0052,pcr bra L01B0 L01C8 leax >L006D,pcr clrb bra L01B0 L01CF pshs u,y,x lda <fpath ldx #$0000 ldu #$0040 os9 I$Seek ldu $04,s bcs L01BE L01E0 leax <u0028,u ldy #$0020 os9 I$Read bcs L01F7 tst ,x beq L01E0 leax >L008F,pcr clrb bra L01B0 L01F7 puls u,y,x cmpb #$D3 bne L01AC rts L01FE fdb $ff41 fdb $ff80,$44ff,$4053,$ff01,$52ff,$0257,$ff04,$45ff fdb $0850,$52ff,$1050,$57ff,$2050,$45ff fcb $00 L021D clr <u0006 L021F lda ,x+ cmpa #C$SPAC beq L021F cmpa #C$COMA beq L021F cmpa #'- bne L0231 com <u0006 lda ,x+ L0231 leax -1,x leay >L01FE,pcr L0237 ldb ,y+ pshs y,x beq L027F L023D lda ,x+ eora ,y+ anda #$DF beq L023D lda -1,y bmi L0251 puls y,x L024B lda ,y+ bpl L024B bra L0237 L0251 lda ,-x cmpa #$30 bcc L027F cmpb #$FF beq L0278 bitb #$80 beq L0268 tst <u0006 lbeq L01C8 lbsr L01CF L0268 puls y,b,a lda <fdesc,u eora <u0006 ora -$01,y eora <u0006 sta <fdesc,u clrb rts L0278 eorb <u0006 stb <u0007 clrb puls pc,y,b,a L027F coma puls pc,y,x emod eom equ * end