comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
Subject: Re: Gnat's Ada.Float_Text_IO.Put problem
Date: Thu, 15 Jan 2004 14:20:04 +0000 (UTC)
Date: 2004-01-15T14:20:04+00:00	[thread overview]
Message-ID: <bu67ik$snf$1@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: bu5rvs$8ki$1@grillo.cs.interbusiness.it

Stefano M. <stefano.m@nospam.tin.it> wrote:
: I suddenly recalled there was a -S switch somewhere, here's what I get:

[slightly condensed:]

$LC0:
      .long 1092745167

      ldgp $29,0($27)   stack pointer, 0(kernel register)
      lda $30,-16($30)  saved, -16(saved)
      lda $1,$LC0       load address register $1, $LC0 (there is 1092745167)
      lds $f10,0($1)    $f10 is a floating point register
      sts $f10,0($30)       (indirectly $LC0 if I'm not mistaken)
      lda $30,16($30)   mirrors second line
      ret $31,($26),1    (31: return address, 26: kernel register)


the 1092745167 from $LC0: is 16#4121F7CF#. It is the same as
the number from offset 6: in the x86 example,

  6:   b8 cf f7 21 41          mov    $0x4121f7cf,%eax         <<----

In binary, this number and its negative (tried for checking) read

2#0_10000010_01000011111011111001111#
2#1_10000010_01000011111011111001111#

In IEEE single precision this means
sign: +
sign: -
Exponent: 130 - 127 = 3
Exponent: 130 - 127 = 3
fraction: (1.)01000011111011111001111
fraction: (1.)01000011111011111001111

With a left_shift of 3 (because exponent = 3) the resulting number
is 2#1010.00011111011111001111# = (-)1.01230E+01 = (-)10.123.

If this interpretation is correct then there is indeed
no representation problem. (I'm not really familiar with any
CPU or fpt, so caveat lector.)

-- Georg



  reply	other threads:[~2004-01-15 14:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 13:39 Gnat's Ada.Float_Text_IO.Put problem Stefano M.
2004-01-14 14:58 ` Adrian Knoth
     [not found] ` <8c4gd1-ifb.ln1@beastie.ix.netcom.com>
2004-01-14 16:11   ` Stefano M.
2004-01-14 16:44     ` Adrian Knoth
2004-01-15  8:14       ` Stefano M.
2004-01-15  8:39         ` Adrian Knoth
2004-01-15 18:50         ` tmoran
2004-01-16  8:23           ` Duncan Sands
2004-01-16  8:48             ` tmoran
2004-01-16  9:45               ` Duncan Sands
2004-01-16 13:18                 ` Jeff C,
2004-01-16 13:52                   ` Duncan Sands
2004-01-15  1:55     ` Georg Bauhaus
2004-01-15  8:46       ` Stefano M.
2004-01-15 11:56         ` Georg Bauhaus
2004-01-15 11:02       ` Stefano M.
2004-01-15 14:20         ` Georg Bauhaus [this message]
2004-01-15  1:50 ` Jeff C,
2004-01-15  8:18   ` Stefano M.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox