Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am working on a program in assembly that adds two 64 bit numbers together. It

ID: 3831434 • Letter: I

Question

I am working on a program in assembly that adds two 64 bit numbers together. It first adds the two Least significant bits then if there is any cary, it adds that to the upper 32 bits. I do not understand how the carry or overflow flag works. the carry flag need to be set, but I can't figure out how to work it. Can someone please help me with this program? I will only thumbs up if it is in the same code I am writing in.

Thank you!

num1:
.long 0x01
.long 0x0
num2:
.long 0x05
.long 0x0
movl (num1), %ebx
movl 4(num1), %ecx
movl (num2), %eax
movl 4(num2), %edx
adc %ebx, %eax #add first 32 bits
add %ecx, %edx
add cf,%edc
cmpl $0, %ebx
je NO_CARRY       #check if there is carry in 32
addl $1, %edx
movl (num1), %ebx
movl (num2), %eax
addl %ebx, %eax
NO_CARRY:
adcl %ecx, %edx
DONE:

Explanation / Answer

if above code has problem just see this one...u need to go for more learning n logicals approches

if u get some problem just tey to manage the allotted memory space

i.e

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote