Instructions: Language of the Machine 习题课(三) Instructions: Language of the Machine Summit Lee 2004.11.23
Instruction Set Design MIPS Instruction Set Architecture 指令系统设计的基本问题 基本操作,操作数,指令格式…… 成本,性能,实际需求…… 概貌 指令系统的基本结构 具体的实现 MIPS指令系统体系结构
Instruction Set Architecture
Instruction Set Design MIPS Instruction Set Architecture 指令系统设计的基本问题 基本操作,操作数,指令格式…… 成本,性能,实际需求…… 概貌 指令系统的基本结构 具体的实现 MIPS指令系统体系结构
MIPS Instruction Set Architecture
Two Small Points A B C D Big Endian and Little Endian PC+4 in Branch Beq $1,$2,25 if ($1==$2) go to PC+4+100 Reason: Instruction Fetch Calculate (PC+4) New look: If we want to go to 25 instructions then :PC(old)+4+96 Beq $1,$2,24 if ($1==$2) go to PC(old)+4+96 eg. 0xABCD Big Endian A B C D 0000 0001 0002 0003
Hints of Homework 3.5 load 32bits immediate 3.14 memory access: Data transfer X2 Else X1 3.17 time=ins X CPI X clock cycle 3.18 3.19 instruction bytes , data bytes neg/sub , dup,reload
Hints of Homework(cont) 3.25 C code Comments Arithmetic: 1, n<0 ? calculate |n| 2, calculate (n%10+48) 3, calculate the length of n/10 4, output sequence:big endian