{====================================================================
3数排序
=====================================================================}
function ThreeNumSort(b, s, g: integer): string;
var
x, y, z: integer;
begin
asm
mov eax, b
mov edx, s
mov ecx, g
cmp eax, edx
jb @Else1
xchg eax, edx
jmp @Else1
@Else1:
cmp eax, ecx
jb @Else2
xchg eax, ecx
@Else2:
cmp edx, ecx
jb @ElseEnd
xchg edx, ecx
@ElseEnd:
mov x, eax
mov y, edx
mov z, ecx
end;
result:=IntToStr(x)+IntToStr(y)+IntToStr(z);
end;
我这样写就能通过,为啥用数组做参数就不行呢?
3数排序
=====================================================================}
function ThreeNumSort(b, s, g: integer): string;
var
x, y, z: integer;
begin
asm
mov eax, b
mov edx, s
mov ecx, g
cmp eax, edx
jb @Else1
xchg eax, edx
jmp @Else1
@Else1:
cmp eax, ecx
jb @Else2
xchg eax, ecx
@Else2:
cmp edx, ecx
jb @ElseEnd
xchg edx, ecx
@ElseEnd:
mov x, eax
mov y, edx
mov z, ecx
end;
result:=IntToStr(x)+IntToStr(y)+IntToStr(z);
end;
我这样写就能通过,为啥用数组做参数就不行呢?