Translate the following pseudo-code assignment statement into IBM PC assembly language. Assume that all variables are signed words.
Digit = Num % 10
main:
push rbp
mov rbp, rsp
mov edx, DWORD PTR [rbp-4]
movsx rax, edx
imul rax, rax, 1717986919
shr rax, 32
sar eax, 2
mov esi, edx
sar esi, 31
sub eax, esi
mov ecx, eax
mov eax, ecx
sal eax, 2
add eax, ecx
add eax, eax
sub edx, eax
mov DWORD PTR [rbp-8], edx
mov eax, 0
pop rbp
ret
Get Answers For Free
Most questions answered within 1 hours.