Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 869 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 869 Bytes

3.4

we had code:

src_t *sp;
dest_t *dp;

and we want implement the operation *dp = (dest_t) *sp;.

Assume that the value of sp and dp are stored in register %rdi and %rsi, respectively.

src_t dest_t instruction
long long movq (%rdi), %rax, movq %rax, (%rsi)
char int movsbl (%rdi), %eax, movl %eax, (%rsi)
char unsigned movsbl (%rdi), %eax, movl %eax, (%rsi)
unsigned char long movzbl (%di), %eax, movq %rax, (%rsi)
int char movl (%rdi), %eax, movb %al, (%rsi)
unsigned unsigned char movl (%rdi), %eax, movb %al, (%rsi)
char short mosbw (%rdi), %ax, movw %ax, (%rsi)