Ive come up with this but I dont think its correct The count

I\'ve come up with this but I don\'t think it\'s correct. The count is throwing me off

Any help will be appreciated. Thank you.
Search ..ooo F 5:31 PM Just using mnemonic instructions such as MOV SUB, ADD etc. no need for a very long program 7. Convert the following C program to x86 assembly code. Use 8086 instruction set. define count 2 int y [2] int main (void) int A B; y [0] A B Count y[1] B count; return (0)

Solution

main:                                                                                                                                                            

.LFB0:                                                                                                                                                           

     pushq   %rbp                                                                                                                                             

        .cfi_def_cfa_offset 16                                                                                                                                   

        .cfi_offset 6, -16                                                                                                                                       

        movq    %rsp, %rbp                                                                                                                                       

        .cfi_def_cfa_register 6                                                                                                                                  

        movl    -8(%rbp), %eax                                                                                                                                   

        movl    -4(%rbp), %edx                                                                                                                                   

        addl    %edx, %eax                                                                                                                                       

        subl    $2, %eax                                                                                                                                         

        movl    %eax, y(%rip)                                                                                                                                    

        movl    $2, %eax                                                                                                                                         

        subl    -8(%rbp), %eax                                                                                                                                   

        movl    %eax, y+4(%rip)                                                                                                                                  

        movl    $0, %eax                                                                                                                                         

        popq    %rbp                                                                                                                                             

        .cfi_def_cfa 7, 8                                                                                                                                        

        ret                                                                                                                                                      

        .cfi_endproc                                                                                                                                             

.LFE0:

I\'ve come up with this but I don\'t think it\'s correct. The count is throwing me off Any help will be appreciated. Thank you. Search ..ooo F 5:31 PM Just usin

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site