



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




CS107 Handout 12 Spring 2008 April 18, 2008
Handout written by Julie Zelenski and Nick Parlante
Load the constant 23 into register 4 R4 = 23 Copy the contents of register 2 into register 3 R3 = R Load char (one byte) starting at memory address 244 into register 6 R6 =.1 Mem[244] Load R5 with the word whose memory address is in R R5 = Mem[R1] Load the word that begins 8 bytes after the address in R1. This is known as "constant offset" mode and is about the fanciest addressing mode a RISC processor will support. R4 = Mem[R1+8]
Begin executing at address 344 if R1 equals 0 BEQ R1, 0, 344 "branch if equal" Begin executing at addr 8 past current instruction if R2 less than R BLT R2, R3, PC+8 "branch if less than"
BLT branch if first argument is less than second BLE less than or equal BGT greater than BGE greater than or equal BEQ equal BNE not equal
Begin executing at address 2000 unconditionally- like a goto Jmp 2000 Begin executing at address 12 before current instruction Jmp PC- 12
Take bits in R3 that represent integer, convert to float, store in R R2 = ItoF R Take bits in R4, convert from float to int, and store back in same Note that converting in this direction loses information, the fractional component is truncated and lost R4 = FtoI R