flat assembler
Message board for the users of flat assembler.

Index > Main > Using doubles (64 bit math)

Author
Thread Post new topic Reply to topic
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 13 Aug 2004, 22:46
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!
Post 13 Aug 2004, 22:46
View user's profile Send private message Visit poster's website Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 14 Aug 2004, 04:27
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
Post 14 Aug 2004, 04:27
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias 14 Aug 2004, 07:14
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
Post 14 Aug 2004, 07:14
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 20 Aug 2004, 20:05
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.
Post 20 Aug 2004, 20:05
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 21 Aug 2004, 00:32
Quote:
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.


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 :-/
Post 21 Aug 2004, 00:32
View user's profile Send private message Visit poster's website Reply with quote
crc



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

_________________
Charles Childers, Programmer
Post 22 Aug 2004, 06:04
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 22 Aug 2004, 11:19
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.
Post 22 Aug 2004, 11:19
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 23 Aug 2004, 13:13
http://srcvault.scali.eu.org/cgi-bin/Syntax/Syntax.cgi?PrintRadix.asm

Have a look around the source vault, there's a number of useful routines there.
Post 23 Aug 2004, 13:13
View user's profile Send private message Visit poster's website Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 09 Sep 2004, 11:57
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. Smile

Regards
Mac2004
Post 09 Sep 2004, 11:57
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.