.title TxtLst .inclu "b:global" sect code .rem & .macro line, Arg2, Arg1 push .if nb Arg1 Write Arg1 .iff Write #lite .endc mov (sp), r1 mov Arg2, r1 clr r0 call deco16 call pcrlf pop .endm ; & .macro Line, a, b ; Magic .endm ;+ ; CrTeLs (CreatTextList) creats a list of unread texts in memory. ; ; Call: MetNr, Meeting # (or zero). ; NrRead, # of read texts. ; Start, START-record if any. ; ; Return: r0, # of unread texts (total, not only those in list). ; Uses FB1, FB2. (Two diskblocks on stack). ;- Proc CrTeLs Var PutP, word ; Flag word Var ChkFlg, word ; Flag word Var NrComm, word ; Number of comments Var RecOne, word ; 1'st MOTTAGET record Var PosOne, word ; Position in that record Var LowNum, word ; Nr of erased texts. Var nct, long ; Non comment text #. Var CurFys, word ; Current fys. text number Var NxtFys, word ; Next - " - - " - Var FBA, DskBlk ; File buffer and comment list. Var BlkANr, word ; Current block in FBA Var FBB, DskBlk ; Filebuffer B. Var BlkBNr, word ; Current block in FBB Var FBBPtr, word ; Pointer to FBB Begin push Line MetNr(r5), #Mt clr FB1-2 clr FB2-2 ; File buffert for file 2. clr BlkBNr(r5) mov #FBB, FBBPtr(r5) add r5, FBBPtr(r5) ; Pointer to FBB mov #CurGrp, r1 mov MetNr(r5), r0 beq 10$ cmp r0, @r1 ; Is it the same meeting as before? bne 20$ ; No! clr MetNr(r5) ; Flag => Don't pop control variables. 10$: tst @r1 ; Is there any meeting before at all? beq 17$ ; No! jmp 100$ ; Use the same meeting. 17$: jmp 9999$ ; No meeting => exit! 20$: cmp #-1, @r1 bne 25$ mov MetNr(r5), @r1 clr MetNr(r5) br 35$ 25$: mov #/2, r0 30$: push (r1)+ ; Save old control variables sob r0, 30$ mov MetNr(r5), CurGrp 35$: mov Start(r5), r0 beq 50$ ; No START-record. Line Start(r5), #St gos Getrec, <#2, r0, #FB2, #Unlock> ; Get START-record. mov #nctrec, r2 mov #/2, r0 tst (r1)+ 40$: mov (r1)+, (r2)+ sob r0, 40$ mov CurGrp, r0 mov #GrpLst, r1 call FindCm gos getrec, <#1, rArg-rStr(r0), FBBPtr(r5), #Unlock> mov 150(r1), r0 beq 45$ cmp nctnum, r0 ; Safty check! blos 50$ 45$: jmp 150$ 50$: clr ltxtre clr ltxtre+2 clr lstlft mov #LibInf, r1 call GetAdr mov 2(r1), higlim ; Get highest text # mov 4(r1), higlim+2 mov CurGrp, r0 mov #GRPLST, r1 call findcm sub #rStr, r0 mov rHigh(r0), hignum ; # of received texts. mov rHigh(r0), nwslft sub NrRead(r5), nwslft ; # of unread texts bgt 60$ jmp 999$ ; Nothing new to read. 60$: gos tryrec, <#1, rArg(r0), FBBPtr(r5), #Unlock> ; Get Meeting. 62$: mov 32(r1), RecOne(r5) mov 34(r1), nctrec ; Last MOTTAGET rekord. mov 156(r1), PosOne(r5) mov 150(r1), r0 ; # of erased texts (by GC). mov r0, LowNum(r5) cmp r0, NrRead(r5) ; Have user read less than that? blos 65$ ; No! mov HigNum, nwslft ; Yes. Sorry but thous texts are sub r0, nwslft ; gone...... mov r0, NrRead(r5) Line #666. 65$: clr r2 mov hignum, r3 dec r3 div #30., r2 mov r2, r4 mov NrRead(r5), r3 mov r3, nctnum ; Local letter number to start beq 90$ cmp r3, LowNum(r5) beq 90$ clr r2 ; with.. dec r3 div #30., r2 sub r2, r4 70$: gos Tryrec, <#1, nctrec, FBBPtr(r5), #Unlock> ; Get previous dec r4 bmi 80$ mov 4(r1), nctrec br 70$ 80$: asl r3 asl r3 add #10, r3 mov r3, nctpos ; Position for last read text add r1, r3 mov (r3), lsttxt ; Last read text # (long) mov (r3), nctext mov (r3)+, lowlim mov (r3), lsttxt+2 mov (r3), nctext+2 mov (r3), lowlim+2 br 200$ 90$: Line #11147 inc nctnum Line nctnum clr lowlim clr lowlim+2 clr lsttxt clr lsttxt+2 mov PosOne(r5), r0 asl r0 asl r0 add #10, r0 mov r0, nctpos mov RecOne(r5), nctrec br 150$ 100$: Line #77. ; Get more news in current meeting. tst lstlft ; News left in list? beq 110$ ; No! jmp 550$ ; Yes! get # of news and exit. 110$: cmp nctnum, hignum blo 150$ mov hignum, NrRead(r5) cmp CurGrp, Thsgr bne 120$ mov hignum, Texrea ; Save nr of TEXts REAd. 120$: jmp 50$ 150$: Line #78. gos TryRec, <#1, nctrec, FBBPtr(r5), #Unlock> 200$: mov r1, r4 ; Pointer to MOTTAGET-buffer. clr lstlft ; No entries left in list. mov #txtlst, lstptr ; Pointer to 1'st word in list mov nctrec, strec mov nctpos, stpos mov nctnum, stnum mov nctext, nct(r5) mov nctext+2, nct+2(r5) mov nctext, lnctre mov nctext+2, lnctre+2 clr FB1-2 clr PutP(r5) tst lsttxt bne 205$ tst lsttxt+2 bne 205$ dec PutP(r5) ; Put all texts 205$: mov #FBA, r3 add r5, r3 ; Pointer to FBA 210$: clr ChkFlg(r5) clr NrComm(r5) ; Not a comment. mov #FB1, r0 mov r4, r1 add nctpos, r1 mov (r1), nctext mov 2(r1), nctext+2 call FysTst mov r0, Curfys(r5) bne 230$ tst PutP(r5) ; This text is erased.... beq 220$ dec nwslft 220$: jmp 400$ 230$: gos TryRec, <#2, CurFys(r5), #FB2, #Unlock> mov 26(r1), r2 ; Next comment on this level. Line 2(r1), #TE Line nctnum, #ncnum tst ChkFlg(r5) ; Are we reading a comment tree? bne 280$ ; Yes => Goto 280$. mov 24(r1), r2 ; Commented text. beq 270$ ; Not a comment. push r1 ; Check Low Limit. gos TstRec, <#2, r2, #FB2> bcc 240$ gos GetRec, <#2, r2, r3, #UnLock> ; use comment stack as buffert. 240$: cmp 4(r1), LowLim+2 bhi 250$ blo 260$ cmp 2(r1), LowLim blo 260$ 250$: pop r1 ; Don't read this text now... jmp 400$ 260$: pop r1 270$: clr (r3)+ ; End of comment-list mark. clr r2 ; Don't use next comment. dec ChkFlg(r5) ; Don't check lowlimit next time. 280$: cmp 4(r1), HigLim+2 ; Check High Limit. blo 290$ beq 286$ 284$: mov r2, NxtFys(r5) ; Next comment (on this level). br 350$ ; This text is new => Skip it! 286$: cmp 2(r1), HigLim bhi 284$ 290$: mov 32(r1), NxtFys(r5) ; Comment to this text. beq 300$ tst r2 ; Next comment on this level. beq 310$ mov r2, (r3)+ ; Push next comment. br 310$ 300$: mov r2, NxtFys(r5) ; Next comment if any. 310$: tst PutP(r5) bne 330$ cmp 2(r1), lsttxt bne 350$ cmp 4(r1), lsttxt+2 bne 350$ dec PutP(r5) br 350$ 330$: dec nwslft cmp 12(r1), Me ; Is this text written by me? beq 350$ ; Yes, skip it. cmp 16(r1), curgrp ; Is this text sent to curent meeting? bne 350$ ; No, skip it. mov CurFys(r5), @lstptr ; Put text in list. add #2, lstptr ; Increas pointer. mov 2(r1), lsttxt ; Last text placed on list mov 4(r1), lsttxt+2 Line 2(r1), #TPS push r3 clr r2 mov lstlft, r3 div #20, r2 mov #1, r0 ash r3, r0 asl r2 bic r0, comflg(r2) pop r3 tst NrComm(r5) beq 340$ ; No! bis r0, comflg(r2) 340$: inc lstlft ; Counter. cmp #NrText, lstlft ; Maximum # of texts in list. beq 500$ 350$: mov NxtFys(r5), CurFys(r5) bne 360$ mov -(r3), CurFys(r5) beq 400$ 360$: inc NrComm(r5) jmp 230$ 400$: tst PutP(r5) ; Is LastText found? bne 405$ ; Yes! cmp nctext, nct(r5) ; Is this the last read tree? bne 405$ cmp nctext+2, nct+2(r5) bne 405$ dec PutP(r5) ; No. Put the hole tree on stack! add NrComm(r5), nwslft ; Warning: Nwslft will be wrong! jmp 210$ 405$: cmp nctnum, hignum bhis 430$ 410$: inc nctnum add #4, nctpos ; Increas pointer. cmp #200, nctpos bhi 420$ mov 2(r4), nctrec gos TryRec, <#1, nctrec, FBBPtr(r5), #Unlock> mov #10, nctpos mov r1, r4 420$: jmp 210$ 430$: clr nwslft 500$: tst lstlft beq 999$ mov #txtlst, lstptr 550$: tst MetNr(r5) beq 600$ add #EOLSTV-CurGrp, sp 600$: mov nwslft, r0 add lstlft, r0 br 9999$ 999$: tst MetNr(r5) beq 1010$ mov #EOLSTV, r1 mov #/2, r0 1000$: pop -(r1) sob r0, 1000$ 1010$: clr r0 9999$: Line r0, #Nt Line nwslft, #Kt Line CurGrp, #Mt Line hignum, #HN Line texrea, #TR pop ret .rem & Text LiTe, <"Line: "> Text Mt, <"M|te: "> Text Nt, <"Antal ol{sta: "> Text Kt, <"Ej p} stacken: "> Text St, <"Start rekord: "> Text HN, <"Hignum: "> Text TR, <"TextRead: "> Text TE, <"Text: "> Text TPS, <"P} stacken: "> Text ncnum, <"Nctnum: "> ; & .even .end