The Add Register instruction performs 2s 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, x00000479, are added to the contents of register 9 which contains x000003FA . The sum is x00000873 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 = XFFFFFFFE -2 IN 2S COMPLEMENT

R5 = X00000028 +40 IN 2S COMPLEMENT

R6 = X00000004 +4 IN 2S COMPLEMENT

AR R4,R5 R4 = X00000026 = +38

AR R4,R4 R4 = XFFFFFFFC = -4

AR R5,R6 R5 = X0000002C = +44

AR R6,R5 R6 = X0000002C = +44