*DECK EXFRSTF
IDENT FIRSTF
ENTRY FIRSTF
USE /TSBMDAT/
CTSBLWA BSS 1
TSBFWA BSS 1
PTSBLWA BSS 1
BIGFREE BSS 1
FFFWA BSS 1
USE /*/
**
* FIRSTF
*
* FIRSTF SEARCHES THE TSB AREA TO LOCATE THE FIRST FREE TSB
* ADDRESS AND SETS THE LOCATION INTO CELL FFFWA
*
*
EJECT
FIRSTF BSS 1
SA3 CTSBLWA LAST ADDRESS TO CHECK
SA1 TSBFWA START ADDRESS OF TSB
SB3 X3
SA2 X1 GET TSB HEADER
FF1 PL X2,FINISH FREE TSB, SEARCH FINISHED
SB2 X2
SA2 A2+B2 NEXT ADDRESS TO CHECK
SB4 A2
LE B4,B3,FF1 NOT AT END OF TSB AREA, SO LOOP
SA2 B3 FORCE ADDRESS TO LAST TSB HEADER
*
* FOUND FREE TSB OR REACHED END OF SEARCH AREA
*
FINISH SX6 A2 SAVE ADDRESS
SA6 FFFWA
EQ FIRSTF RETURN
END