News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

hla fist

Started by ms, February 14, 2005, 10:55:30 PM

Previous topic - Next topic

ms

I have problems with the following segment of code (hla 1.74):

static
    qw0: int64;
    w0: int16;

begin xxx;
    fist(w0);       // compiles OK, but the manual says "32 and 64 bits only!" (Hla Ref man, p219)

All the other combinations of fpu load/store for integer operands appears OK.
Regards

Randall Hyde

Quote from: ms on February 14, 2005, 10:55:30 PM
I have problems with the following segment of code (hla 1.74):

static
    qw0: int64;
    w0: int16;

begin xxx;
    fist(w0);       // compiles OK, but the manual says "32 and 64 bits only!" (Hla Ref man, p219)

All the other combinations of fpu load/store for integer operands appears OK.
Regards

Manual is wrong, HLA is right. The following works as expected:

program t;
#include( "stdlib.hhf" )

static
    qw0: int64;
    w0: int16 := 1;
    w1: int16 := 2;

begin t;
    fldz();
    fist(w0);
    stdout.put( "w0=", w0, " w1=", w1, nl );     

end t;

That is, it prints "w0=0 w1=2" as w1 does not get overwritten (as would be the case if this code were actually writing 32 bits).
Cheers,
Randy Hyde

raymond

ms

Are you sure that the manual was referring to the fist instruction.

If it was, then it is wrong because you CANNOT use fist for 64-bit integers. If, however, it was referring to the fst instruction, then it was correct.

The fist and fst instructions are not the same.

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Randall Hyde

Quote from: raymond on February 16, 2005, 01:43:18 AM
ms

Are you sure that the manual was referring to the fist instruction.

If it was, then it is wrong because you CANNOT use fist for 64-bit integers. If, however, it was referring to the fst instruction, then it was correct.

The fist and fst instructions are not the same.

Raymond

Hmmm... News to me. The following code compiles and runs just fine:

program t;
#include( "stdlib.hhf" )

static
    qw0: int64;
    w0: int16 := 1;
    w1: int16 := 2;
    w2: int64 := 1_234_567_890_123;
    f2: real80;

begin t;
    fldz();
    fist(w0);
    stdout.put( "w0=", w0, " w1=", w1, nl );
    fild( w2 );
    fstp( f2 );
    stdout.put( "flt(w2)=", f2, nl );     

end t;

Cheers,
Randy Hyde
\

raymond

QuoteHmmm... News to me. The following code compiles and runs just fine:

I don't disagree with your posted code assembling and running OK. It didn't contain any fist qword instruction!!!

My post stated:
Quoteyou CANNOT use fist for 64-bit integers

Raymond

When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Randall Hyde

Quote from: raymond on February 16, 2005, 09:07:00 PM
QuoteHmmm... News to me. The following code compiles and runs just fine:

I don't disagree with your posted code assembling and running OK. It didn't contain any fist qword instruction!!!

My post stated:
Quoteyou CANNOT use fist for 64-bit integers

Raymond



Duh....
Next time I'll have to read things a little closer.
No, you can't use fist with 64-bit integers.  :naughty:
Cheers,
Randy Hyde