// Immediate
let Supplement =
!cond(
- !eq(size, 8) : (descend 0b00000000, (operand "$"#opnd_name, 8)),
- !eq(size, 16) : (operand "$"#opnd_name, 16),
- !eq(size, 32) : (ascend (slice "$"#opnd_name, 31, 16),
- (slice "$"#opnd_name, 15, 0))
+ !eq(size, 8) : (descend 0b00000000, (operand "$"#opnd_name, 8,
+ (encoder "encodeRelocImm<8>"))),
+ !eq(size, 16) : (operand "$"#opnd_name, 16,
+ (encoder "encodeRelocImm<16>")),
+ !eq(size, 32) : (operand "$"#opnd_name, 32,
+ (encoder "encodeRelocImm<32>"),
+ (decoder "DecodeImm32"))
);
}
; INSTR: move.l dst, %d0
; FIXUP: fixup A - offset: 2, value: dst, kind: FK_Data_4
move.l dst, %d0
+
+; Relocating immediate values
+
+; RELOC: R_68K_8 str8 0x0
+; INSTR: move.b #str8, (4,%sp)
+; FIXUP: fixup A - offset: 3, value: str8, kind: FK_Data_1
+move.b #str8, (4,%sp)
+
+; RELOC: R_68K_16 str16 0x0
+; INSTR: move.w #str16, (4,%sp)
+; FIXUP: fixup A - offset: 2, value: str16, kind: FK_Data_2
+move.w #str16, (4,%sp)
+
+; RELOC: R_68K_32 str32 0x0
+; INSTR: move.l #str32, (4,%sp)
+; FIXUP: fixup A - offset: 2, value: str32, kind: FK_Data_4
+move.l #str32, (4,%sp)