WTRN1.MAC;4/au/-bf=[13,10]WTRN1.MAC;1 -11,37,/;DLE001/ $VERSION x0402 -192,192,/;DLE001/ CMP (SP),2(R0) ; possibly be in the header -197,209,/;DLE001/ MOVB (R0),W.VBN(R1) ; Load window with MOV 2(R0),W.VBN+2(R1) ; new starting VBN 110$: call .gtrtp ; Point R0 at header map pointers movb .hdbuf+m.use,r4 ; Fetch number of map words BIC #177400,R4 ; clear high just in case BEQ 180$ ; Can't see why this should ever happen MOV R4,-(SP) ; Save number of map words ; ; R0 points to the mapping pointers in the header -257,275,/;DLE001/ 150$: dec (sp) ; Count these words mov (r0)+,r4 ; Fetch pointer in header block bmi 152$ ; Three or four word pointer ? ; it's a two word pointer here mov r4,r2 ; Set up for extent and MSB bic #177400,r4 ; Set extent count bic #140377,r2 ; Fetch the msb of lbn swab r2 ; Place into lower part dec (sp) ; Count these words mov (r0)+,r3 ; Fetch lsb br 160$ ; ; This is a three or four word entry 152$: bit #40000,r4 ; Find out if three or four bne 154$ ; If bit on then four word ; We have a three word entry bic #140000,r4 ; Remove type field dec (sp) ; Count this word mov (r0)+,r3 ; Fetch lsb of lbn dec (sp) mov (r0)+,r2 ; msb of lbn br 160$ ; Finish up in exit routine ; ; This is a four word entry 154$: bic #140000,r4 ; Clear type field bne 156$ ; Test for hugh count? ; Not so hugh make like a < 64k block cmp #-1,(r0) ; Test for overflow on window store beq 156$ dec (sp) ; Count previous word mov (r0)+,r4 ; Fetch extent LSB dec (sp) ; Count this word mov (r0)+,r3 ; Fetch lsb of lbn dec (sp) mov (r0)+,r2 ; msb of lbn br 160$ 156$: ; At this point we need to make an extra window block. The size of ; the extent is >64k blocks so we will dummy up to make an ; extra block with 64K-1 blocks and then finish up mov r4,-(sp) ; Save msb of block count on stack mov (r0)+,r4 ; Fetch lsb of block count mov (r0)+,r3 ; Fetch lsb of lbn mov (r0)+,r2 ; msb of lbn ; mov #-1,(r5)+ ; set a large block count mov r2,(r5)+ ; Store msb of lbn mov r3,(r5)+ ; lsb of lbn incb (r1) ; Say we have used a pointer ; Let's make up a new map block and go back to the start inc r4 ; Bump lsb of block count for 1 less then 64K bne 157$ ; Test for overflow inc (sp) ; Bump if overflow 157$: tst r3 ; Will the lsb of lbn underflow? bne 158$ ; If not zero then no dec r2 ; Decrement msb of lbn 158$: dec r3 ; Back up lsb of lbn inc r2 ; Bump msb of lbn dec (sp) ; Any more windows needed? mov r2,-(r0) ; Restore map pointer msb of lbn mov r3,-(r0) ; lsb of lbn mov r4,-(r0) ; Restore extent bis #140000,(sp) mov (sp)+,-(r0) ; Reset word type and etc inc (sp) ; Restore word counter br 165$ ; ; need to make a last window entry 160$: incb (r1) ; Count window entry mov r4,(r5) ; store in window block inc (r5)+ ; Make it correct count mov r2,(r5)+ ; store msb of lbn mov r3,(r5)+ ; store lsb of lbn -280,298,/;DLE001/ 165$: tst (sp) ; Test if any pointers left in header bgt 120$ ; Loop to process next extent -304,305,/;DLE001/ 170$: TST (SP)+ ; Pop off header pointer count 180$: CMP (SP)+,(SP)+ ; Pop off the desired VBN -330,330,/;DLE001/ .IFF ; No multi headers -338,341,/;DLE001/ call .gtmap ; Get offset to map area ADD #M.USE,R0 ; Form address of m.use -353,353,/;DLE001/ ;************** need to fix this area for single header block ****** /