Question

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

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!

Homework Answers

Answer #1

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))

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT