Memory reference instruction

7

Click here to load reader

description

Sanjeev Patel 4x

Transcript of Memory reference instruction

Page 1: Memory reference instruction

MEMORY REFERNCE

INSTRUCTIONS

PRESENTED BY:SURBHI

Page 2: Memory reference instruction

MEMORY REFERENCE MEMORY REFERENCE INSTRUCTIONSINSTRUCTIONS

• The bits in IR 12 to 14 determines the memory reference instruction type if the bits were from 000 to 110.

• Used here a 3 by 8 decoder is used to decode the 3 bits to 8 lines D0 to D7, although D7 not used here.

• The effective address of the instruction is in AR and was placed there during timing signal T2 when I = 0, or during timing signal T3when I = 1.

• Data from memory must be accessed to processor during T4.

Page 3: Memory reference instruction

AND TO AC

D0T4 : DR M[AR]

D0T5 : AC AC DR, SC 0

ADD TO AC

D1T4 : DR M[AR]

D1T5 : AC AC+ DR, E COUT, SC 0

Page 4: Memory reference instruction

LDA : LOAD TO AC

D2T4 : DR M[AR]

D2T5 : AC DR, SC 0

STA : STORE AC

D3T4 : M[AR]AC, SC 0

Page 5: Memory reference instruction

BUN : BRANCH UNCONDITIONALLY

D4T4 : PC AR, SC 0

BSA: BRANCH AND SAVE RETURN ADDRESSD5T4 : M[AR] PC, AR AR+ 1

D5T5 : PC AR, SC 0

Page 6: Memory reference instruction

0 BSA 135

Next instruction

Subroutine

1 BUN 135

0 BSA 135

Next instruction

Subroutine

1 BUN 135

20

PC=21

AR=135

136

20

21

135

PC=136

(b) memory and pc after execution

(a) Memory ,PC AND AR AT TIME T4

MEMORY MEMORY

Example of BSA

Page 7: Memory reference instruction

ISZ : INCREMENT AND ISZ : INCREMENT AND SKIP IF ZEROSKIP IF ZERO

D6T4 : DR M[AR]

D6T5 : DR DR+1

D6T6 : M[AR] DR, if(DR=0) then (PC

PC + 1, SC 0