Translate this code into assembly language Translate this co

Translate this code into assembly language

Translate this code into assembly language # for (t 4 = 4; t 4 > 0; t 4 - -) # {# for(t 8 = 7; t 8 > 0; t 8 - -) # {# midast t 6 ++ = (1 & t7) ? t3: t2; # t 7 >> = 1; #} # t 7 >> = 1; #}

Solution

.Ltext0: .globl main main: .LFB0: .cfi_startproc 0000 55 pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 0001 4889E5 movq %rsp, %rbp .cfi_def_cfa_register 6 0004 C745E404 movl $4, -28(%rbp) 000000 000b EB3D jmp .L2 .L7: 000d C745E807 movl $7, -24(%rbp) 000000 0014 EB27 jmp .L3 .L6: 0016 488B45F8 movq -8(%rbp), %rax 001a 488D5004 leaq 4(%rax), %rdx 001e 488955F8 movq %rdx, -8(%rbp) 0022 8B55EC movl -20(%rbp), %edx 0025 83E201 andl $1, %edx 0028 85D2 testl %edx, %edx 002a 7405 je .L4 002c 8B55F0 movl -16(%rbp), %edx 002f EB03 jmp .L5 .L4: 0031 8B55F4 movl -12(%rbp), %edx .L5: 0039 836DE801 subl $1, -24(%rbp) 0034 8910 movl %edx, (%rax) 0036 D17DEC sarl -20(%rbp) .L3: 0046 836DE401 subl $1, -28(%rbp) 003d 837DE800 cmpl $0, -24(%rbp) 0041 7FD3 jg .L6 0043 D17DEC sarl -20(%rbp) .L2: 004a 837DE400 cmpl $0, -28(%rbp) 004e 7FBD jg .L7 0050 B8000000 movl $0, %eax 00 0055 5D popq %rbp .cfi_def_cfa 7, 8 0056 C3 ret .cfi_endproc .LFE0: .Letext0:
Translate this code into assembly language Translate this code into assembly language # for (t 4 = 4; t 4 > 0; t 4 - -) # {# for(t 8 = 7; t 8 > 0; t 8 - -

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site