On pure Pascal code, “Error: Asm: ESP/RSP cannot be used as index register” or “Error: Asm: Invalid effective address”.
Attempting to compile this code for i386/win32
or x86-64/win64
with -O2
or greater:
procedure DoSomething(index, cellSize: SizeUint);
var
buf: array[0 .. 127] of byte;
begin
(pByte(buf) + index * cellSize)^ := 5;
end;
begin
end.
Results in Error: Asm: Invalid effective address
or Error: Asm: ESP/RSP cannot be used as index register
, respectively.
Edited by Rika