Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What would be the correct y86-64 assembly code equivalent of the x86-64 line of

ID: 3797488 • Letter: W

Question

What would be the correct y86-64 assembly code equivalent of the x86-64 line of assembly below?
leaq   8(%rsi), %rsi

Also, if you could provide a few other examples of common, difficult conversions from x86-64 to y86-64 assembly code, I would greatly appreciate it. I know a few of the single- and two-line assembly equivalents in y86-64 (such as movq -> irmovq or mrmovq), but quite a few others like the one above aren't quite as intuitive for me. Perhaps a table containing some of the more difficult conversions would be helpful? Thank you!

Explanation / Answer

solution:-

Given Instruction is -- leaq   8(%rsi), %rsi

this is a x86-64 code which is used to load effective address (leaq) in designated register. Here given register is %rsi and 8 is offset. the content of %rsi register a memory address and offset 8 is added to memory address. Now this effective addressstored to the register %rsi.

Now if we implement this instruction in  y86-64 code then we use "rrmovq" instrucion. this instruction simply moves the content of a register to another register. So required instruction in y86-64 code is-

rrmovq 8(%rsi), (%rsi)

Some other examples are-

In y86-64 code

irmovq: immediate to register (ex: irmovq $18600, %r8)

rrmovq: register to register (ex: rrmovq %r8, %r9)

mrmovq: memory to register (ex: mrmovq (%rbp), %rdx )

rmmovq: register to memory (ex: rmmovq %rdx, (%rbp))

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote