         SYSTEM   SIG7FDP
         SYSTEM   BPM
         DEF      C:ALT
R5       EQU      5
R6       EQU      6
R7       EQU      7
R10      EQU      10
R11      EQU      11
SAVRG    RES      3
BUFCNT   DATA     0
BUFADR   RES      50
*
*  THIS RUNLIB SAVE THE ADDRESS OF ALTERED BUFFER
*      AND CLEAR THE BUFFER AFTER PERFORM
*   INPUT - R7 CONTAINS BUFFER ADDRESS FOR SAVE, 0 FOR CLEAR
*   LINKAGE - R10 FOR CLEAR BUFFERS
*             R11 FOR SAVE BUFFER ADDRESS
*
C:ALT    LCI      3
         STM,R5   SAVRG
         AI,R7    0
         BEZ      ALTC              CLEAR THE BUFFER
         LW,R6    BUFCNT
ALTP     AI,R6    -1
         BLZ      ALTS              NOT ALTERED
         CW,R7    BUFADR,R6
         BE       ALTR              MATCHED
         B        ALTP
ALTS     LW,R6    BUFCNT
         STW,R7   BUFADR,R6         SAVE BUFFER ADDRESS
         MTW,1    BUFCNT
ALTR     LCI      3
         LM,R5    SAVRG
         B        *R11
ALTC     XW,R7    BUFCNT
         BEZ      ALTE              NO ADDRESS SAVED
         LI,R6    0
ALTD     LW,R5    BUFCNT,R7
         STW,R6   0,R5              CLEAR THE BUFFER
         BDR,R7   ALTD
ALTE     LCI      3
         LM,R5    SAVRG
         B        *R10
         END
