Notes From CS Undergrad Courses FSU
This project is maintained by awa03
To encode branch instructions, we first need to calculate the value for the associated label. This is done by the assembler
Mips has restricted alignment. The encoded instruction are word aligned, which means all the labels will be multiples of 4.
To increase the range, we encode the address divided by 4
Branch target/ branch displacement/ branch offset: the number of instructions between the branch instruction and the target instruction
l2: instruction # Opcode :4
instruction # rs: t0(8), rt: t1 (9)
instruction # branch target:-4 (16 b)
BEQ $t1, $t0, L2
This is done by...
Enter NOTES from 5/31 here
2 Address Forms. These instructions implicitly use the internal registers hi and lo. We would then need to move the values from these internal registers into the programmer-usable registers.
mult rs, rt
div rs, rt
mfhi $rd
mflo $rd
% is the same then as normal division within MIPS programming
Sys call 4 - Prints the string with the starting address 0 Sys call 11 - Prints character stored in a0 Sys call 8 - reads a string from console. a0 should contain the starting address of the unformatted free space, and a1 should contain the maximum number of characters to read Sys call 12 - reads a character from the console and returns it in v0
jal l1
- Jump and link so the computer knows where to return to following the jump