How to pass Register to CodeAssembler method? #358
Answered
by
ultimaweapon
ultimaweapon
asked this question in
Q&A
-
I tried to write the following code: fn transform_lea64(&mut self, i: Instruction) -> usize {
if i.is_ip_rel_memory_operand() {
let dst = i.op0_register();
let src = i.ip_rel_memory_address();
if let Some(label) = self.labels.get(&src) {
self.assembler.lea(dst, label.clone()).unwrap();
} else {
let label = self.assembler.create_label();
self.assembler.lea(dst, label).unwrap();
self.jobs.push_back((src, self.offset(src), label));
}
15
} else {
self.assembler.add_instruction(i).unwrap();
i.len()
}
} But |
Beta Was this translation helpful? Give feedback.
Answered by
ultimaweapon
Oct 14, 2022
Replies: 1 comment
-
Just found there is a |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ultimaweapon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just found there is a
get_gpr64
method to convertRegister
toAsmRegister64
.