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.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to