         PCC      0
*M*      SCRAM    SCRAMBLE LOGON PASSWORDS
*
*P*      NAME:    SCRAM
*P*      PURPOSE: SCRAMBLE LOGON PASSWORDS FOR TEL,CCI,LOGON AND SUPER
*P*      DESCRIPTION: SCRAM USES AN IRREVERSIBLE ALGORITHM STARTING
*P*               WITH A SEED WORD TO ENCODE PASSWORDS.
*
*D*      NAME:    SCRAM
*D*      PURPOSE: TO ENCODE LOGON PASSWORDS
*D*      DESCRIPTION:
*D*               INPUT: R12-R13 - BLANK FILLED TEXT PASSWORD
*D*               OUTPUT: R6-R7  - ENCODED PASSWORD
*D*               WORK: R2-R4
*D*               LINK: R11
         PAGE
******************************************************************************
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
****************************************************************************
         SPACE    4
         SYSTEM   SIG7
         DEF      SCRAM             ENTRY POINT OF SCRAMBLER
         CSECT    0
         REF      SEED              SEED FOR SCRAMBLER
SCRSEED  DATA     SEED
         DEF      SCRSEED
         CSECT    1
SCRAM    LW,R6    SCRSEED
         BNEZ     SCR0
         LD,R6    R12               IF SEED IS ZERO NO SCRAMBLE
         B        *R11
SCR0     LI,R2    0
SCR1     LB,R3    R12,R2            GET CHARACTER
         LW,R4    R3
         SLS,R4   -4
SCR2     LW,R7    R6
         MW,R6    R6                SQUARE IT
         SCD,R6   7,R3              SELECT SOME PORTION
         EOR,R6   R7
         BDR,R4   SCR2
         AI,R2    1
         CI,R2    7
         BLE      SCR1
         B        *R11
         END

