COMPSCI 61C Lecture Notes - Lecture 9: C Dynamic Memory Allocation, Nested Function

30 views5 pages

Document Summary

Useful to operate on elds of bits within a word characters within a word (8 bits) Shift left: s11 , 2 #s1 = s2<<2. Store in the value from shifted 2 bits to the left (they fall o end), inserting 0"s on right; << in c. Shift right arithmetic moves n bit to the right (insert high order sign bit into empty bits) C arithmetic semantics is that division should round towards 0. Means: go to statement labeled l1 if (value in register1) == (value in register2) . otherwise go to the next statement beq stands for branch if equal. Other instruction: bne for branch if not equal. Conditional branch - change control ow depending on outcome of comparison branch if equal (beq) or branch if not equal (bne) Unconditional branch: always branch a mips instruction for this: jump(j) General programs need to test < and > as well.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents