More Load Instructions

Load and Test Register

  Format: LTR  R1,R2

  - loads the contents of R2 into R1 and sets
    the condition code


  Code   Meaning
   0     R1 contains 0
   1     R1 contains a negative number
   2     R1 contains a positive number


  - use this instruction to check if a register contains the value 0
    because the only thing that happens is that the condition code is
    set

 

Load Positive Register

  Format: LPR  R1,R2

  - loads the absolute value of the contents of R2 into R1
    and sets the condition code


  Code   Meaning
   0     R1 contains 0
   1     ---
   2     R1 contains a positive number
   3     Overflow occurred


  - overflow will occur if R2 contains the maximum negative

 

Load Negative Register

  Format: LNR  R1,R2

  - loads the negative of the absolute value of the contents of R2
    into R1 and sets the condition code


  Code   Meaning
   0     R1 contains 0
   1     R1 contains a negative number

 

Load Complement Register

  Format: LCR  R1,R2

  - loads the complement (opposite) of the contents of R2 into R1
    and sets the condition code


  Code   Meaning
   0     R1 contains 0
   1     R1 contains a negative number
   2     R1 contains a positive number
   3     Overflow occurred


  - overflow will occur if R2 contains the maximum negative

 

Load Address

  Format:  label  LA  R,D(X,B)

  - Calculates the absolute address represented by D(X,B) and loads it
    into the last 3 bytes of R.  The first byte is set to 00.


  Some Possible Uses:

  1. Initialize a register to a value between 0 and 4095

       LA  10,50     puts the number 50 into register 10


  2. Add a value from 1 to 4095 to a register

       LA  5,4(,5)   adds 4 to the value in register 5 and stores it
                     back into register 5


  3. Add 3 numbers together

       LA  10,375(4,5)   adds 375 to the values in registers 4 and 5
                         and stores it in register 10


  4. Put the address of a storage field in a register

       LA  5,TABLE   puts the address of the label TABLE in register 5