COMPSCI 61C Lecture Notes - Lecture 11: C Data Types, Opcode, Assembly Language

40 views4 pages

Document Summary

De ne elds of he following number of bits each: 6 + 5 + 5 + 16 = 32 bits. Each eld has a name: opcode, rs, rt, immediate. Key concept: only one eld (no rd, so rt is the register to write) is inconsistent with. Especially important that opcode is in the same location. The immediate field: addi, addiu, slti, sltiu, lw, sw the immediate is sign-extended to. 32 bits, so it"s treated as a signed integer. 16 bits can be used to represent immediate up to 216 di erent values. Large enough to handle o set in a typical lw or sw, plus a vast majority of values that will be used in the slti instruction. Mips instruction: addi , , -50 opcode = 8 (look up in table in book) rs = 22 (register containing operand) rt = 21 (target register) immediate = -50 (by default, this is decimal in assembly code.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents