70 likes | 205 Views
ITEC 352. Lecture 14 ISA(6). Review. Questions? Beginning / End Memory locations Variable / Memory syntax PSR Loops / Branches. More assembly. What does the program I show you do? How important are comments in assembly?
E N D
ITEC 352 Lecture 14 ISA(6)
Review • Questions? • Beginning / End • Memory locations • Variable / Memory syntax • PSR • Loops / Branches
More assembly • What does the program I show you do? • How important are comments in assembly? • How would we write a JAVA program that would produce similar assembly? • What are the benefits / downsides of each approach to writing the software? • Why are the memory locations offset by 4?
Conditionals How would you use these conditionals? • ba • Always branch • bne • Brach when Z is not 0 • be • Branch when Z is 0 • bg /bgeble • Branch when not (Z or (N xor V)) • bpos / bneg • Branch when negative bit is on or off • bv(c/s) • Overflow bit cleared or set
Jumping • call • Goto a specific label in the program (memory where label is must be within 30 bits of the call statement) • Saves location of where call is in %r15 • jmpl • Goto a specific address and store the location of the jmpl in %r15
Shifty • Shift right (srl) • Shift a register by a certain % of bits and store the result in another register (0s are padded) • Syntax? • Shift left (sll) • Instead of the right, go left • Why is shifting bits important?
Summary • Assembly instructions / simple program