home *** CD-ROM | disk | FTP | other *** search
- ; ********************************************************************
- ; * *
- ; * Tree V1.3 (C) 1988 by M.Stoll & M.Zepf & H.E.Stöffler *
- ; * --------- *
- ; * Program is placed in PUBLIC DOMAIN and may be *
- ; * freely distributed with sourcecode and docu- *
- ; * mentation. *
- ; * Files included in Achive: *
- ; * Use Seka-Assembler. - Tree.S *
- ; * - Tree.Doc *
- ; * To contact us: - Write to: Matthias Zepf - Tree *
- ; * Riegeläckerstr. 27 *
- ; * D-7250 Leonberg *
- ; * West Germany *
- ; * *
- ; * - Call: (+49) 7152 41917 (West Germany) *
- ; * *
- ; * - Electronic Mail: (+49) 7031 44788 (ELIAS) *
- ; * (+49) 7031 36339 (dateMail) *
- ; * (+49) 0711 813480 (microTalk/FNet) *
- ; * *
- ; * - UUCP: Smart: Agnus@Aragon.UUCP *
- ; * Domain: ...!{uunet!mcvax}!unido!altger!aragon!agnus *
- ; * *
- ; * Bitte zuerst Tree.doc lesen! Please read Tree.doc first! *
- ; * *
- ; ********************************************************************
-
- openlib = -408
- output = -60
- input = -54
- read = -42
- write = -48
- exit = -144
- lock = -84
- unlock = -90
- waitforchar = -204
- currentdir = -126
- examine = -102
- exnext = -108
- allocmem = -198
- freemem = -210
- parentdir = -210
- findtask = -294
- Setsignal = -306
-
- move.l a0,adresse
- move.l d0,comlang
- move.l 4,a6
- lea dosname,a1
- jsr openlib(a6)
- move.l d0,dosbase
- move.l d0,a6
- jsr output(a6)
- move.l d0,outhandle
- jsr input(a6)
- move.l d0,inhandle
- clr.l d1
- move.l adresse,a0
- cmp.l #0,a0
- beq fehler1
- move.l comlang,d0
- cmp.l #1,d0
- beq Current
- lab1: cmp.b #" ",(a0)+
- bne lab3
- subq.l #1,d0
- bne lab1
- bra fehler1
- lab3: sub.l #1,a0
- cmp.b #"?",(a0)
- beq fehler2
- lea name,a1
- lab2: move.b (a0)+,(a1)+
- cmp.b #":",-1(a1)
- beq lab4
- subq.l #1,d0
- bne lab2
- bra fehler1
- lab4: clr.b (a1)
- lea name,a1
- move.l a1,d1
- move.l #-2,d2
- move.l dosbase,a6
- jsr lock(a6)
- tst.l d0
- beq fehler3
- move.l d0,actlock
- lab_weiter:
- move.w #1,lockcount
- move.l #270,d0
- move.l #$10001,d1
- move.l 4,a6
- jsr allocmem(a6)
- move.l d0,actpuff
- move.l d0,d2
- move.l actlock,d1
- move.l dosbase,a6
- jsr examine(a6)
- jsr infoname
- lea name,a0
- lea zeile,a1
- lea Pfad,a2
- su1: move.b (a0)+,(a1)+
- move.b -1(a0),(a2)+
- bne su1
- move.b #":",-1(a1)
- move.b #":",-1(a2)
- clr.b (a1)
- clr.b (a2)
- jsr gebaus
- schleife:
- move.l actlock,d1
- move.l actpuff,d2
- move.l dosbase,a6
- jsr exnext(a6)
- stop: tst.l d0
- beq pop
- move.l actpuff,a0
- tst.l 4(a0)
- bmi schleife
- push: add.w #1,lockcount
- jsr appendname
- jsr zeilaus
- sub.w #1,lockcount
- pushi: move.l actlock,d1
- move.l actpuff,d2
- move.l dosbase,a6
- jsr exnext(a6)
- move.l d0,success
- tst.l d0
- beq push_setbit
- move.l actpuff,a0
- tst.l 4(a0)
- bmi pushi
- clr.l d0
- move.w lockcount,d0
- clr.l d1
- bset d0,d1
- not.l d1
- and.l d1,bitter
- bra pushwei
- push_setbit:
- clr.l d0
- move.w lockcount,d0
- clr.l d1
- bset d0,d1
- or.l d1,bitter
- pushwei:
- add.w #1,lockcount
- move.l actlock,-(a7)
- move.l actpuff,-(a7)
- move.l success,-(a7)
- move.l #Pfad,d1
- move.l #-2,d2
- move.l dosbase,a6
- jsr lock(a6)
- move.l d0,actlock
- move.l #270,d0
- move.l #$10001,d1
- move.l 4,a6
- jsr allocmem(a6)
- move.l d0,actpuff
- move.l d0,d2
- move.l actlock,d1
- move.l dosbase,a6
- jsr examine(a6)
- clr.l d0
- clr.l d1
- move.l 4,a6
- jsr SetSignal(a6)
- btst #12,d0
- bne unlockall
- bra schleife
- pop: move.l actpuff,a1
- move.l #270,d0
- move.l 4,a6
- jsr freemem(a6)
- tst.w unlockflag
- beq unlockes
- cmp.w #1,lockcount
- beq ende
- unlockes:
- move.l actlock,d1
- move.l dosbase,a6
- jsr unlock(a6)
- sub.w #1,lockcount
- beq ende
- move.l (a7)+,success
- move.l (a7)+,actpuff
- move.l (a7)+,actlock
- jsr removename
- tst.l success
- beq pop
- bra push
- Current:move.w #"CU",unlockflag
- sub.l a1,a1
- move.l 4,a6
- jsr findtask(a6)
- move.l d0,a0
- move.l 152(a0),d1
- move.l d1,actlock
- move.l dosbase,a6
- cu_loop:jsr parentdir(a6)
- tst.l d0
- beq cu_end
- tst.l userlock
- beq cu_nix
- move.l d0,-(a7)
- move.l userlock,d1
- jsr unlock(a6)
- move.l (a7)+,d0
- cu_nix: clr.w unlockflag
- move.l d0,d1
- move.l d0,actlock
- move.l d0,userlock
- bra cu_loop
- cu_end: bra lab_weiter
- infoname:
- move.l actpuff,a0
- lea 8(a0),a0
- lea name,a1
- inf1: move.b (a0)+,(a1)+
- bne inf1
- rts
- leerzeile:
- lea zeile,a0
- move.w #$0a00,(a0)
- gebaus: lea zeile,a0
- allgaus:move.l outhandle,d1
- move.l a0,d2
- clr.l d3
- lab7: addq.l #1,d3
- tst.b (a0)+
- bne lab7
- move.b #10,-1(a0)
- move.l dosbase,a6
- jmp write(a6)
- unlockall:
- move.l actpuff,a1
- move.l #270,d0
- move.l 4,a6
- jsr freemem(a6)
- tst.w unlockflag
- beq un1_all
- cmp.w #1,lockcount
- beq endeI
- un1_all:move.l actlock,d1
- move.l dosbase,a6
- jsr unlock(a6)
- sub.w #1,lockcount
- beq endeI
- unlocki:move.l (a7)+,a1
- move.l (a7)+,a1
- move.l #270,d0
- move.l 4,a6
- jsr freemem(a6)
- move.l (a7)+,d1
- tst.w unlockflag
- beq un2_all
- cmp.w #1,lockcount
- beq endeI
- un2_all:move.l dosbase,a6
- jsr unlock(a6)
- sub.w #1,lockcount
- bne unlocki
- endeI: move.l outhandle,d1
- move.l #break,d2
- move.l #breakend-break,d3
- move.l dosbase,a6
- jsr write(a6)
- ende: clr.l d0
- clr.l d1
- move.l dosbase,a6
- jmp exit(a6)
- getend: lea pfad,a0
- ge_1: tst.b (a0)+
- bne ge_1
- sub.l #1,a0
- rts
- appendname:
- jsr getend
- cmp.b #":",-1(a0)
- beq an_1
- move.b #"/",(a0)+
- an_1: move.l actpuff,a1
- lea 8(a1),a1
- lea name,a2
- an_2: move.b (a1)+,(a0)+
- move.b -1(a1),(a2)+
- bne an_2
- rts
- removename:
- jsr getend
- rem_2: cmp.b #"/",-1(a0)
- beq rem_3
- cmp.b #":",-1(a0)
- beq rem_1
- clr.b -(a0)
- bra rem_2
- rem_3: clr.b -(a0)
- rem_1: rts
- spaces: move.b #" ",(a0)+
- bra Zeil_ll
- zeilaus:lea zeile,a0
- lea name,a1
- move.b #" ",(a0)+
- move.w lockcount,d0
- sub.w #1,d0
- beq zeil_end
- sub.w #1,d0
- beq keinspc
- clr.l d2
- zeil_loop:
- add.l #1,d2
- clr.l d3
- bset d2,d3
- move.l bitter,d4
- and.l d3,d4
- bne spaces
- move.b #"|",(a0)+
- zeil_ll:move.b #" ",(a0)+
- move.b #" ",(a0)+
- sub.w #1,d0
- bne zeil_loop
- keinspc:move.b #"+",(a0)+
- move.b #"-",(a0)+
- z_loop2:move.b (a1)+,(a0)+
- bne z_loop2
- jsr gebaus
- zeil_end:
- rts
- Fehler1:move.l #Fehlerm1,d2
- move.l #Fehlerm1end-Fehlerm1,d3
- bra fehlerallg
- Fehler2:move.l #Fehlerm2,d2
- move.l #F2ende-Fehlerm2,d3
- bra fehlerallg
- Fehler3:move.l #Fehlerm3,d2
- move.l #Fehlerm3end-Fehlerm3,d3
- bra fehlerallg
- fehlerallg:
- move.l outhandle,d1
- move.l dosbase,a6
- jsr write(a6)
- bra ende
-
- ; ---------------------------------------------------------------------
-
- dosname: dc.b 'dos.library',0
- even
- Fehlerm1: dc.b "**Kein Device angegeben. [device missing]",10,0
- Fehlerm1end:
- even
- Fehlerm2: dc.b 10,$9b,"7;31;40",$6d," Tree V1.3 ",$9b,"0;31;40"
- dc.b $6d," © 1988 by "
- dc.b $9b,"1;31;40",$6d,"M.Stoll & M.Zepf &"
- dc.b " H.E.Stöffler ",$9b,"0;31;40",$6d,10
- dc.b "Dieses Programm darf frei kopiert werden. Es "
- dc.b "handelt sich dabei um PUBLIC-",10
- dc.b "DOMAIN-Software. [This program may be "
- dc.b "freely distributed. It is placed in",10
- dc.b "the PUBLIC DOMAIN.]",10,10
- dc.b "Benutzung: Tree <Device>",10,10,0
- F2ende:
- even
- break: dc.b "**Abbruch! [Break!]",10,0
- breakend:
- even
- Fehlerm3: dc.b "**Ungültiges Device angegeben. [device invalid]",10,0
- Fehlerm3end:
- even
- dosbase: dc.l 0
- adresse: dc.l 0
- inhandle: dc.l 0
- outhandle: dc.l 0
- tre_getr: dc.l 0
- comlang: dc.l 0
- userlock: dc.l 0
- actlock: dc.l 0
- actpuff: dc.l 0
- lockcount: dc.l 0
- success: dc.l 0
- unlockflag: dc.w 0
- Bitter: dc.l 0
- dummy: dc.w 0
- even
- name: blk.b 120
- even
- zeile: blk.b 256
- even
- Pfad: blk.b 1024
- even
- dospuff: blk.b 20
- even
-
-