In Delphi, you can directly access some registers such as EAX, and perform the following code in Delphi6 will not jump loop.
Procedure delphi6eaxbug; // loops forever with delphi 6
VAR
i: integer;
Begin
For i: = 0 to 15 do
ASM
MOV Eax, 2
END;
END;
Solution
Procedure delphi6eaxbug;
VAR
i: integer;
Begin
For i: = 0 to 15 do
ASM
Push EAX
MOV Eax, 2
POP EAX
END;
END;