Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I ' m writing code to add two 6 4 bit integers together using 3 2 bit registers in assembly. I ' m not sure

I'm writing code to add two 64 bit integers together using 32 bit registers in assembly. I'm not sure what is wrong with my code, but I'm failing tests and having issues compiling. Here it is: .global start
.equ wordsize, 4
.data
num1: .long 1,1
num2: .long 1,1
.text
_start:
movl num1,%eax #eax = first half num1
movl num2,%ecx #ecx = first half num2
addl %ecx, %eax
movl (%eax),%ecx #ecx = second half num1
movl (%ebx),%edx #edx = second half num2
addl %ecx, %edx
jnc end_carry
carry:
addl $1,%eax
end_carry:
nop
done:
nop

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago