git-svn-id: trunk@6203 -
This commit is contained in:
florian 2007-01-26 17:40:30 +00:00
parent d614eab0fb
commit ca4412e09f
2 changed files with 57 additions and 0 deletions

1
.gitattributes vendored
View File

@ -8006,6 +8006,7 @@ tests/webtbs/tw8156.pp svneol=native#text/plain
tests/webtbs/tw8171.pp svneol=native#text/plain
tests/webtbs/tw8172.pp svneol=native#text/plain
tests/webtbs/tw8183.pp svneol=native#text/plain
tests/webtbs/tw8199.pp svneol=native#text/plain
tests/webtbs/tw8222.pp svneol=native#text/plain
tests/webtbs/tw8222a.pp svneol=native#text/plain
tests/webtbs/tw8222b.pp svneol=native#text/plain

56
tests/webtbs/tw8199.pp Normal file
View File

@ -0,0 +1,56 @@
{ %cpu=i386 }
{$APPTYPE CONSOLE}
{$ifdef fpc}
{$mode delphi}
{$endif}
program AsmDifference;
type
TnxInt64 = Int64; {64-bit signed Integer}
TnxValueRelationship = -1..1;
const
nxSmallerThan = Low(TnxValueRelationship);
nxEqual = 0;
nxGreaterThan = High(TnxValueRelationship);
function nxCmpI64(const a, b : TnxInt64) : TnxValueRelationship;
//begin
// if a = b then
// Result := nxEqual
// else if a < b then
// Result := nxSmallerThan
// else
// Result := nxGreaterThan;
//end;
asm
xor eax, eax
mov edx, [ebp+20]
cmp edx, [ebp+12]
jg @@GT
jl @@LT
mov edx, [ebp+16]
cmp edx, [ebp+8]
ja @@GT
je @@EQ
@@LT:
dec eax
dec eax
@@GT:
inc eax
@@EQ:
end;
var
a, b: TnxInt64;
begin
a := 12884901889;
b := 12884901890;
if nxCmpI64(a, b)<>-1 then
halt(1);
writeln('ok');
end.