Song Liu
Ex: LOAD R1, =100 Load the number 100 to register R1.
Direct addressing is a scheme in which the address specifies which memory word or register contains the operand.
For example:
1) LOAD R1, 100 Load the content of memory address 100 to register R1. 2) LOAD R1, R2 Load the content of register R2 to register R1.
For example: 1) LOAD R1, @100 Load the content of memory address stored at memory address 100 to the register R1. R1 M[100] M[200] - 200 10 LOAD R1,@100 10 200 10 2) LOAD R1, @R2 Load the content of the memory address stored at register R2 to register R1.
For example: 1) LOAD R1, 100(R2) Load the content of the memory address which is the sum of 100 and the content of register R2 to register R1. R1 R2 M[100] M[110] - 10 200 150 LOAD R1, 100(R2) 150 10 200 150 2) LOAD R1, =100(R2) Load the sum of 100 and the value of register R2 to register R1. 3) LOAD R1, @100(R2) Load the content of the memory address stored at the memory address which is the sum of 100 and the number in register R2 to the register R1. R1 R2 M[100] M[110] M[150] - 10 200 150 300 LOAD R1, @100(R2) 300 10 200 150 300
Computers that are stack-oriented have an instruction to push the contents of a memory location or a register onto the stack. Instructions with no addresses are used in conjunction with a stack. This form of addressing specifies that the two operands are to be popped off the stack, one after another, the operation performed and the result pushed back onto the stack.