1 .equ $fprel, 2 2 .set mips16 3 4 .ent foo 5foo: 6 move $2,$gp 7 8 # Test various forms of relocation syntax. 9 10 li $4,(%hi gvar) 11 sll $4,16 12 addiu $4,(%lo (gvar)) 13 lw $4,%lo gvar($5) 14 15 # Check that registers aren't confused with $ identifiers. 16 17 lw $4,($fprel)($17) 18 19 # Check various forms of paired relocations. 20 21 lw $4,%got(lvar)($2) 22 sb $5,%lo(lvar)($4) 23 24 lw $4,%got(lvar)($2) 25 addiu $4,%lo(lvar) 26 27 # Check individual relocations. 28 29 lw $3,%call16(gfunc)($2) 30 addiu $4,%call16(gfunc) 31 32 lw $4,%gprel(gvar)($2) 33 sw $4,%gprel(gvar)($2) 34 addiu $4,%gprel(gvar) 35 .align 6 36 .end foo 37 38 .data 39lvar: .word 1,2 40