This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Small question for ASM gurus!


Small question for ASM gurus!

Postby kornalius » Feb 4, 2004 @ 3:35am

User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Postby warmi » Feb 4, 2004 @ 3:52am

warmi
pm Insider
 
Posts: 518
Joined: Aug 24, 2002 @ 8:07am
Location: Chicago USA


Postby Exocet » Feb 4, 2004 @ 5:20am

Why you would ever want to do double precision floating point artithmetic in ARM escapes me, but heres the jist of it.

That number being pushed onto the stack (in x86 assembly by the way) is an IEEE double precision floating point number.

where the first bit is the sign
the next 11 bits are the exponent (base 2) in excess ((2^10)-1) notation
the remaining 52 bits are the mantisa with an assumed 1 before them

so 40250000 00000000h is really

[0][100 0000 0010][01010.....0] (in binary)

the sign bit is 0 ie. positive
the exponent - ((2^10)-1) is 2^3

the last bits are the exponent
(1).010100000000000000 = 1.3125 * 2^3 = 10.5

so that is how you do it... my suggestion to you is to pick up any computer architecture book and look up the IEEE standard, because there are special representations for infinity, overflows and zero and can probably explain it more concisely then I can.

On arm you would place the lowest 32 bits into r0 and the highest 32 bits into r1, as per the calling convention set out in the docs with VC++ME (those ohh soo minimal docs on arm assembly)
Exocet
pm Member
 
Posts: 18
Joined: Jun 29, 2003 @ 2:24am
Location: Toronto, Canada


Postby kornalius » Feb 4, 2004 @ 1:07pm

User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Postby kornalius » Feb 4, 2004 @ 2:42pm

User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

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 post attachments in this forum

cron