Github username: trevorbonas
Github: Link to github repo (your assignment repos are private so these links are only accessible to TAs and Instructor) g...@github.com:CMPT-295-SFU/assignment-2-trevorbonas.git
Line and file: Line 140 utils.c
Expected behavior: Running make part1:
00001020: jal x0, -12
00001050: jal x0, 8
Observed behavior: Running make part1
00001020: jal x0, -2561
00001050: jal x0, 2048
Question: From reading others' questions I think my get_jump_offset function in utils.c isn't implemented correctly, but I honestly don't understand why the function is needed or how it would be implemented. I'm thinking that jal takes a destination register, in this case x0, and stores the current instruction's address there and then jumps to label (i.e., the address stored in instruction.ujtype.imm). The label is 20 bits long, I sign extended it so that it's a whole integer I can work with but this isn't enough. What steps should I take?