473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Assembly

Hello n Greetings to everyone......

I m having this problem in assembly language assignment that i m adding two 32 bit numbers(main problem how it should be done without using adc since i m a novice)

how should i extend the 16 bit register to assign a 32 bit number to it.....i have read in my assembly book that to define some extra memory v use....db or dw...ie a bit or word....what i dont under stand is that i have defined the memory but how exactly m i supposed to tell the assembler that use "ax" n "newly defined memory" to store the word....

can somebody tell me......i m not lazy since i have been looking for an answer to it for 3 days on net n now i have no other way
Feb 16 '07 #1
2 1044
Banfa
9,065 Expert Mod 8TB
The maximum carry from an addition is 1 so you do something like

32 bit int Op1
32 bit int Op2
32 bit int Result


LOAD low 16 bits of OP1 into AX
Add low 16 bits of OP2 to AX
Store AX in Low 16 bits of Result

IF CARRY IS 1
LOAD AX with 1
ELSE
LOAD AX with 0
ENDIF

Add high 16 bits of OP1 to AX
Add high 16 bits of OP2 to AX
Store AX in high 16 bits of Result

result now contains the final value of the calculation.
Feb 16 '07 #2
thanx that was helpful

The maximum carry from an addition is 1 so you do something like

32 bit int Op1
32 bit int Op2
32 bit int Result


LOAD low 16 bits of OP1 into AX
Add low 16 bits of OP2 to AX
Store AX in Low 16 bits of Result

IF CARRY IS 1
LOAD AX with 1
ELSE
LOAD AX with 0
ENDIF

Add high 16 bits of OP1 to AX
Add high 16 bits of OP2 to AX
Store AX in high 16 bits of Result

result now contains the final value of the calculation.
Feb 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Terence Shek | last post by:
Is there a way to set the application binding policy so that it always binds to the latest version of an assembly? I'm hoping there is a way to avoid updating the application's binding...
26
by: nospam | last post by:
Just wondering, What do you think the difference in performance would be between (1.) Compiled C# (2.) Compiled C++ (3.) and Assembly Language And how would the mix be if some if any of...
2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
7
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
1
by: Tim F | last post by:
Problem: I'm receiving the error "File or assembly name XXXXX or one of its dependencies, was not found." when trying to execute code in an assmebly that has both a strong-name and has been...
2
by: Paul | last post by:
Hi, I have experience in Java and C++ but I am rather new to C# and just started learning it. I am using Visual C# 2005 Express Edition and I found that there is a file called "AssemblyInfo.cs",...
1
by: Coaster | last post by:
orig ref here http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/ff29cc370678911d/c0db5b7e3da283b9?lnk=st&q=gac+assembly+new+version&rnum=7#c0db5b7e3da283b9...
14
by: Monty | last post by:
Hello, I have created a solution which has both a web UI and a winform UI, the latter is just for administrators. The Web UI (a Web Application Project) and the winform project both...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.