SR     JOB   TEST SAR, SBR INSTRUCTIONS
       ORG   500
START  CS    332
       CS
       MLCWA @TEST OF SAR INSTRUCTION@,250
       W
       CS    299
       H
       MLC   LOC2,LOC1
*      REGISTERS AFTER
*            A        B
*           LOC2-1   LOC1-1
*          (LOC1)
       SAR   RESULT
       MLCWA WANT,250
       MLCWA EXPECT
       W     
       CS    299
       MLCWA RESULT,250
       MLCWA GOT
       W
       CS    299
       W
       MLCWA @END OF SAR TEST@,250
       W
       CS    299
*
*      TEST SBR INSTRUCTION
*
       MLCWA @TEST SBR INSTRUCTION@,250
       W
       CS    299
       MLCWA @LENGTH 7@,250
       W
       CS    299
       SBR   B1G,B2
       MLCWA B1E,250
       MLCWA EXPECT
       W
       CS    299
       MLCWA B1G,250
       MLCWA GOT
       W     
       CS    299
       MLCWA @LENGTH 4@,250
       W
       CS    299
       MLC   LOC1,LOC2
*      REGISTERS AFTER EXECUTION
*            A       B
*            LOC1-1  LOC2-1
*                    (LOC1)
       SBR   RESULT
       MLCWA WANT,250
       MLCWA EXPECT
       W
       CS    299
       MLCWA RESULT,250
       MLCWA GOT
       W
       CS    299
       B     SUBR                            SUBROUTINE CALL
RET    MLCWA @RETURNED FROM SUBROUTINE@,250
       W
       CS    299
*
       MLCWA @END OF SBR TEST@,250
       W
       CS    299
       H     *-3
*
SUBR   SBR   ESUBR+3
       MLCWA SWANT+3,250
       MLCWA EXPECT
       W
       CS    299
       MLCWA ESUBR+3,250
       MLCWA GOT
       W
       CS    299
ESUBR  B     0
*      THIS IS THE INSTRUCTION WE EXPECT TO CREATE (USE THIS FOR PRINTOUT)
SWANT  B     RET
*
* THE FOLLOWING TWO LOCATIONS MUST BE ADJACENT
LOC1   DCW   #1                              ONE CHAR FIELD
LOC2   DCW   #1                              ONE CHAR FIELD
*
RESULT DCW   #3
WANT   DSA   LOC1
EXPECT DCW   @EXPECT: @
GOT    DCW   @GOT:    @
*
B1G    DCW   #3
B1E    DSA   B2
B2     DCW   @RANDOM ADDRESS...@
       END   START
