Assembler Code can not be compiled
Original Reporter info from Mantis: SonnyBoy
-
Reporter name: Norbert Sonnleitner
Original Reporter info from Mantis: SonnyBoy
- Reporter name: Norbert Sonnleitner
Description:
Try to compile the following function:
function MakeProcInstance(M: TMethod): Pointer;
begin
GetMem(Result, 15);
asm
// MOV ECX,
MOV BYTE PTR [EAX], $B9
MOV ECX, M.Data
MOV DWORD PTR [EAX+$1], ECX
// POP EDX (put old jump back adress to EDX)
MOV BYTE PTR [EAX+$5], $5A
// PUSH ECX (add "self" as parameter 0)
MOV BYTE PTR [EAX+$6], $51
// PUSH EDX (put jump back adress back on stack)
MOV BYTE PTR [EAX+$7], $52
// MOV ECX, (move adress to ECX)
MOV BYTE PTR [EAX+$8], $B9
MOV ECX, M.Code
MOV DWORD PTR [EAX+$9], ECX
// JMP ECX (jump to first put down command and call method)
MOV BYTE PTR [EAX+$D], $FF
MOV BYTE PTR [EAX+$E], $E1
// No call here or there would be another jump back adress on the stack
end;
end;
Error: WinTools.pas(299,31) Error: Can't access fields directly for parameters
Line 31 is MOV ECX, M.Data
Steps to reproduce:
Compile with 3.1.1 SVN Rev 36870.
With SVN Rev 35806 and before the compiling is successful
Mantis conversion info:
- Mantis ID: 32318
- OS: Windows
- OS Build: 10
- Build: SVN Rev 36870
- Platform: Intel
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 37886 (#1b669957)