- 2
- 0
- 约1.37万字
- 约 56页
- 2020-06-30 发布于湖北
- 举报
CS61C L6 Machine Rep Chap 2.4 - Instruction Representation Jen-Chang Liu, Spring 2006 Adapted from /~cs61c/ Review Instructions: Arithmetic: add, addi, sub Memory access: lw, sw Branch: beq, bne, j comparison: slt, slti, sltu, sltiu Review of Lab#2: memory access “Computer Organization” Hierarchy of Programming Languages Q: How do we represent instructions in machine? Overview Instructions as Numbers R-Format I-Format Branch instruction: addressing mode J-Format Instructions as Numbers (1/2) Currently all data we work with is in words (32-bit blocks): Each register is a word. lw and sw both access memory one word at a time. So how do we represent instructions? Remember: Computer only understands 1s and 0s, so “add $t0,$0,$0” is meaningless. MIPS wants simplicity: since data is in words, make instructions be words... Instructions as Numbers (2/2) One word is 32 bits, so divide instruction word into “fields”. Each field tells computer something about instruction. We could define different fields for each instruction, but MIPS is based on simplicity, so define 3 basic types of instruction formats: R-format I-format J-format Instruction Formats J-format: used for j and jal I-format: used for instructions with immediates (含常數的指令) lw and sw (since the offset counts as an immediate) the branches (beq and bne) (but not the shift instructions; later) R-format: used for all other instructions Registers as operands Overview Instructions as Numbers R-Format I-Format Branch instruction: addressing mode J-Format R-Format Instructions (1/5) Define “fields” of the following number of bits each: R-Format Instructions (2/5) What do these field integer values tell us? opcode: partially specifies what instruction it is (Note: This number is equal to 0 for all R-Format instructions.) funct: combined with opcode, this number exactly specifies the instruction Question: Why aren’t opcode and funct a single 12-bit field? Answer: We’ll answer this later. R-Format Instructions (3/5)
您可能关注的文档
最近下载
- 《园林生态学》教学课件(第1-4章).pptx VIP
- 《公文写作能力提升专项培训课件》.ppt VIP
- 2024-2025学年上海市普陀区六年级下学期数学期末试题含详解.pdf VIP
- 制造业企业员工高离职率分析.pdf VIP
- GB50461-2024:石油化工静设备安装工程施工质量验收规范.pptx VIP
- 三江A116火灾报警控制器简易操作规程.docx
- (新版)社会体育指导员理论知识考试题库(含答案).docx VIP
- DB31T 1104-2018 城市轨道交通导向标识系统设计规范.docx VIP
- 2023年浙江省军队转业干部录用考试试题.docx VIP
- 口渴了-朋友帮你.ppt VIP
原创力文档

文档评论(0)