Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science 210 Computer Organization

Similar presentations


Presentation on theme: "Computer Science 210 Computer Organization"— Presentation transcript:

1 Computer Science 210 Computer Organization
Machine Language Instructions: Data Movement

2 Data Movement Move data from memory to a register (load - LD, LDR, LDI, LEA) Move data from a register to memory (store - ST, STR, STI) Opcode Src or Address info Dst

3 PC-Relative Mode To compute the memory address:
Sign-extend the address info (9-bit twos comp) Add the result to the incremented PC Opcode Src or Address info Dst

4 PC-Relative: LD and ST RDst  M[PC + offset] M[PC + offset]  RSrc
RDst  M[PC + offset] LD R x1AF M[PC + offset]  RSrc ST R x1AF The operation is executed after the PC has been incremented Address must be within +256 or -255 of the LD or ST instruction

5 Data Path for LD

6 Data Path for ST

7 PC-Indirect Mode To compute the memory address:
Sign-extend the address info (9-bit twos comp) Add the result to the incremented PC Use this address to locate another address in memory Opcode Src or Address info Dst

8 PC-Indirect: LDI and STI
RDst  M[M[PC + offset]] LDI R x1CC M[M[PC + offset]]  RSrc STI R x1CC Contents at the address is another address, which can be anywhere in memory

9 Data Path for LDI

10 Base + Offset Mode To compute the memory address:
Sign-extend the offset info (6-bit twos comp) Add the result to contents of the base register Opcode Src or Base Offset Dst

11 Base + Offset: LDR and STR
RDst  M[base + offset] LDR R R x1D M[base + offset]  RSrc STR R R x1D Address does not depend on the PC Offset must range from -32 to +31

12 Data Path for LDR

13 Load Effective Address (LEA)
Computes the address like PC-relative and just stores the result in the destination register Memory is not accessed Opcode Src or Address info Dst

14 Data Path for LEA

15 For Friday Control Instructions


Download ppt "Computer Science 210 Computer Organization"

Similar presentations


Ads by Google