This presentation is the property of its rightful owner.
1 / 21

# 以动画形式看几条指令的执行过程： 2200: ADD R2, R3 ； 3 条指令的地址为 2200 、 2201 、 2202 PowerPoint PPT Presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

#### Presentation Transcript

2200: ADD R2, R3 ；3 条指令的地址为2200、2201、2202

2201: JRNC 2200 ；若C=0 转去执行第1条，否则顺序执行

2202: STRR [R2], R3 ； 把 R3的内容写入内存地址为 [R2] 的单元

JRNC指令的二进制代码为 01000101 1111 1110，已在内存中

STRR指令的二进制代码为 10000011 0010 0011，已在内存中

3 条指令都要在取指周期执行读取指令的操作，

JRNC指令要在 执行周期完成指令地址计算并保存功能； 结束

STRR指令要在 执行周期完成数据地址计算并保存功能，

2 2 0 1

4 5 F E

0 0 3 2

0 0 3 2

1

1

2 2 0 0

2 2 0 0

REGs(3) + REGs(2)

→ REG(3)

R3的内容为2345

b_sel 选 00

a_sel选 00

s_sel 选 00

r_sel 选 00

alu_func 选 000

reg_src 选 00

reg_wt 选 1

flag_func选001

00000000 0010 0011

+

2

2

0

1234

1234

0

2345

2345

3579

3

3

0 0

2 2 0 2

4 5 F E

4 5 F E

0 0 2 3

1

2 2 0 1

2 2 0 1

0 0 2 3

JRNC 2200

01000101 11111110

0 0

2 2 0 0

4 5 F E

0 0 2 3

2 2 0 2

4 5 F E

F E

2 2 0 3

8 3 2 3

8 3 2 3

0 0 3 2

1

1

2 2 0 2

2 2 0 2

4 5 F E

STRR [R2]， R3

R2的内容为1234

R3的内容为3579

10000001 0010 0011

00

+

2

2

1234

1234

3579

1234

1234

0000

3

3

STRR [R2]，R3

10000001 0010 0011

00

+

2

1234

0000

3579

3579

1234

3

3579

3579

3

1234

8132

1 2 0 2

4 5 F E

4 5 F E

0 0 2 3

1

1 2 0 1

1 2 0 1

alu_func= OP 码, reg_wt=1 (cmp、test 除外), flag_func=001

alu_func= 000或001, reg_wt=1, flag_func=001

alu_func= 000, reg_wt=1, flag_func=011 (或100)

MVRD指令

JMPA指令

CALA指令-1

b_src=01, r_sel=11, alu_func=001, reg_wt=1, ar_wt=1

CALA指令-2

RET指令_1

b_sel=01, r_sel=11, reg_wt=1

RET指令_2

gate_en=1, mio=1