The Add Register instruction performs 2’s complement binary addition.  Operand 1 is a register containing a fullword integer.  Operand 2 specifies a register as well.  The fullword in Operand 2 is added to the fullword in Operand 1,  and the sum replaces the contents of Operand 1.  Operand 2 in unchanged by this operation except when Operand 1 and 2 refer to the same register.  Consider the following example,    

 

                            AR    R9,R8

               

 

 

   The contents of the fullword in register 8, x’00000479’, are added to the contents of register 9 which contains x’000003FA’ .  The sum is x’00000873’  and replaces the previous value in R9.  The contents of register 8 are unchanged by this operation.

 

   The condition code is set by this instruction to zero (0) if the result is zero, it is set to minus (1) if the result is negative, and to plus (2) if the result is positive.

 

            Some Unrelated Add Registers

 

              R4 =  X’FFFFFFFE’   -2 IN 2’S COMPLEMENT

              R5 =  X’00000028’  +40 IN 2’S COMPLEMENT

              R6 =  X’00000004’   +4 IN 2’S COMPLEMENT

  

              AR    R4,R5    R4 = X’00000026’ = +38

              AR    R4,R4    R4 = X’FFFFFFFC’ = -4

              AR    R5,R6    R5 = X’0000002C’ = +44

              AR    R6,R5    R6 = X’0000002C’ = +44