I'm using this textbook Randal E. Bryant, David R. O’Hallaron - Computer Systems. A Programmer’s Perspective [3rd ed.] (2016, Pearson). For this problem 3.43 I am not sure why a few of the questions yields a assembly code as seen in the given answer.
Firstly, I am unsure as to why there is a addition of 10 for the case of &up->t1.w
before the movw
.
Secondly, I'm unsure about why the up->t2.a
yields only a single line in assembly when the first 2 examples required us to do the following:
movq (%rdi), %rax
movq %rax, (%rsi)
What changed?
Thirdly, a similar confusion for the line up->t2.a[up->t1.u]
being translated as such:
movq (%rdi), %rax
movl (%rdi,%rax,4), %eax
movl %eax, (%rsi)
Any and all help is appreciated, thank you!