Page 1 of 1

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
by answerhappygod
Suppose Variable R Of Type Struct Rec Is In Register Rdi Also Assume Sizeof Int 4 And There Is No Padding In The 1
Suppose Variable R Of Type Struct Rec Is In Register Rdi Also Assume Sizeof Int 4 And There Is No Padding In The 1 (56.09 KiB) Viewed 29 times
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)