CS241 : wk5sol.pdf
Document Summary
1 relocation: the instructions that needs to be relocated by the loader are the . word directives that use a label. So the ones that needs to be relocated are lines: 0x08, 0x10, 0x38: to generate a merl le, we need to construct the header and the relocation table. 0x10000002 - cookie, equivalent to beq sh, sh, 2. Length of header + code - in bytes: the relocation table has relocation entries with format: 0x01 - format code to designate this entry as a relocation entry. 0x44 cookie length of merl length of header + code bne , sh, endlabels lis . word 0x04 add , , b: jr lis . word 0xbad beq , sh, a add , , a: jr endprogram . word endprogram (rel) 0x00000044 format code for rel location of . word a format code for rel location of . word b format code for rel location of . word endprogram.