flat assembler
Message board for the users of flat assembler.

 Index > Main > Using doubles (64 bit math)
Author
crc

Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
I'm trying to make sense of doubles (64 bit). Basically I want to add/subtract/multiply/divide 64-bit integers. But I have no idea how to do any of this. I've heard that the FPU has instructions that can handle 64-bit math, but I've never used the FPU instructions (and have no idea what they are!). If anyone has sample code that shows how to do any of these things, please share it!
13 Aug 2004, 22:46
roticv

Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv
Try bitrake's snipplet

http://www.bitrake.com/phpBB2/topic.php?t=62

I think using fpu for 64bit integer maths is a bad idea
14 Aug 2004, 04:27
tom tobias

Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
you may wish to employ some of the newer registers, sorry, I have no experience with them, but I believe they are 128 bits wide. Regards, tom
14 Aug 2004, 07:14
vid
Verbosity in development

Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
tom: yes, they are, but they are purposed to work with multiple number at the same time, not on one big. MMX is for integers (whole numbers), SSE for floats. FPU works with single floating point numbers.

crc: chapter 8 (maybe 9) of my tuts will be about this, but you probably wouldn't want to wait for it (few month maybe). Anyway, check "adc" and "sbb" instructions about adding and substracting.
20 Aug 2004, 20:05
crc

Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
Quote:

Thank you for the pointers. I'm (slowly) starting to make sense of 64 bit numbers. Vid, I'll watch for chapters 8 & 9 of your tutorial; this is one aspect of assembly programming that I'm finding quite confusing :-/
21 Aug 2004, 00:32
crc

Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
I *think* I have addition and subtraction working now, but I have no idea how to display the result The value is in EDX:EAX Does anyone know how to display this in a console (Linux, FreeBSD, Windows, or BeOS?)

_________________
Charles Childers, Programmer
22 Aug 2004, 06:04
vid
Verbosity in development

Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
if you want display it decimal, you need division and modulo operations.

by the way, there is something about combining two number into one in my tutorial, maybe it would help.
22 Aug 2004, 11:19
f0dder

Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder

Have a look around the source vault, there's a number of useful routines there.
23 Aug 2004, 13:13
Mac2004

Joined: 15 Dec 2003
Posts: 313
Mac2004
Hi!

Take a look at Randall Hyde's Art of Assembly book. Randall's teaching how to do 64bit and 128bit math. That could help you.

Regards
Mac2004
09 Sep 2004, 11:57
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum