Can somebody explain me about REAL8 treatment in assembler?

I need to compare for example two double numbers. I have searched on the internet and I cant find any example. Please help me urgently..

I have to compare two REAL8 to know if they are the same, I have to makey many operations more but after I can have one example I can make the others alone..

I need to compare for example two double numbers. I have searched on the internet and I cant find any example. Please help me urgently..

I have to compare two REAL8 to know if they are the same, I have to makey many operations more but after I can have one example I can make the others alone..

`SonIgualesDouble proc var1:REAL8, var2:REAL8`

mov eax:ebx, var1 -> It doesnt work

ret

SonIgualesDouble endp

end;

mov eax,

mov ebx,

You can't expect a 32 bit processor to natively handle 64 bit data. If it did it'd be a 64 bit processor.

Mirno

`SonIgualesDouble proc var1:REAL8, var2:REAL8`

mov eax,

mov ebx,

ret

SonIgualesDouble endp

end;

pentium.asm(182) : error A2070: invalid instruction operands

pentium.asm(183) : error A2070: invalid instruction operands

The syntax you wrote seems to be Incorrect.

Please tell me how would i return a real8 value to my C program, becouse as far i know the return values are always store in eax register and its 32 bits long.???

Thanks

I think you should be passing by reference.

Could you expplain me on how to do this. Or if you have examples..

Thanks

Thanks

where a double value is returned may vary for different compilers.

with VC (32bit) the return value is in st(0). You can easily verify this by compiling this code with -Fa switch:

double func1(double dd)

{

return dd*2;

}

main()

{

func1(1.0);

return 0;

}

`SonIgualesDouble proc var1:REAL8, var2:REAL8`

mov eax,

mov ebx,

ret

SonIgualesDouble endp

end;

pentium.asm(182) : error A2070: invalid instruction operands

pentium.asm(183) : error A2070: invalid instruction operands

You have encountered MASM's "type" checking, or more properly, "size" checking. You will need to override the size of the var1 operand with

? ? mov eax,dword ptr

I use RADASM with MASM32 and devc++

as I understand

mov eax,dword ptr this moves the 32 most significant bits of a number into eax

mov ebx,dword ptr this moves the 32 least signifant bits of a number into ebx

According to this

http://babbage.cs.qc.edu/courses/cs341/IEEE-754.html

0.85 in binary is

0 01111111110 1011001100110011001100110011001100110011001100110011

sign exponent mantissa

so EAX will have = 0 01111111110 10110011001100110011

and ebx will have this 00110011001100110011001100110011

as I understand

mov eax,dword ptr this moves the 32 most significant bits of a number into eax

mov ebx,dword ptr this moves the 32 least signifant bits of a number into ebx

According to this

http://babbage.cs.qc.edu/courses/cs341/IEEE-754.html

0.85 in binary is

0 01111111110 1011001100110011001100110011001100110011001100110011

sign exponent mantissa

so EAX will have = 0 01111111110 10110011001100110011

and ebx will have this 00110011001100110011001100110011

Command the computer to show you what you're doing!

You can create two functions. Each returns a different portion of your double value. Display them in hex (format code is %x, to get 8 digits with zero padding on the left, use %08x).

You can create two functions. Each returns a different portion of your double value. Display them in hex (format code is %x, to get 8 digits with zero padding on the left, use %08x).