[fpc-pascal] fpc-2.1.4.x86_64-win64.exe: Problem with int64 ? or Problem with Large Decimal values in asm ?

Skybuck Flying skybuck2000 at hotmail.com
Thu Jul 26 11:19:23 CEST 2007


Hello,

This is my first attempt at writing AT&T asm code and also 64 bit asm code:

The output is supposed to be 2^64 - 1 but it displays 2^32-1.

Did I program a bug ?

Or is the compiler bugged ?

Maybe writeln bugged ?

What's wrong ?

// *** Begin of Code ***

program HelloWorld;

{$mode delphi}

var
 test : int64;
begin
 writeln('Hello Free Pascal World !');

 asm
  mov $10, %eax
  mov %eax, test  // no size warnings, kinda nice ;) or could it hide bugs 
in the future ?
 end;

 writeln('Test: ', test );

 asm
  mov $100, %eax
  mov %eax, test
 end;

 writeln('Test: ', test );


 // $7FFFFFFFFFFFFFFF not recognized.
 // bug: only lower bits moved ?
 // $100 is this hexadecimal 100 or decimal 100 ?
 // the test above shows 100.. I guess 100 decimal then...
 // somewhere below is a bug: 4294967295
 // maybe move instruction is only 32 bits ?
 // maybe rax is only 32 bits.. but isn't it 64 bits ?
 asm
  mov $9223372036854775807, %rax
  mov %rax, test
 end;

 writeln('Test: ', test );

 readln;
end.

// *** End of Code ***

Bye,
  Skybuck. 




More information about the fpc-pascal mailing list