Suppose variable r of type struct rec ∗ is in register \%rdi. Also assume sizeof(int) =4 and there is no padding in the
Posted: Thu Jul 14, 2022 2:17 pm
Suppose variable r of type struct rec ∗ is in register \%rdi. Also assume sizeof(int) =4 and there is no padding in the structure. Which one of the following sequences of assembly instructions copies element r−>i to element r−>j ? a. leaq (\%rdi), \%eax ; movl \%eax, 4 (\%rdi) b. movl \%rdi, \%eax ; movl \%eax, 4(% rdi) c. leaq 4 (\%rdi), \%eax ; movl \%eax, (\%rdi) d. movl 4(\%rdi), \%eax ; movl \%eax, (\%rdi) e. movl (\%rdi), \%eax ; movl \%eax, 4 (\%rdi) f. movl (\%rdi), \%eax ; movl \%eax, 8(% rdi)