Marco van de Voort wrote 24 lines
I agree with you but it doesn't work. For instance, take this procedure
procedure nx_fill(P: PLongword; Count: Longint; Value: Longword);
assembler;
asm
pushl %edi
movl Value,%eax
movl Count,%ecx
movl P,%edi
rep
stosl
popl %edi
end;in the .s file, FPC 1.9.4 produces this:
.globl NXKERNEL_NX_FILL$PLONGWORD$LONGINT$LONGWORD pushl %ebp
movl %esp,%ebp
pushl %edi
movl %ecx,%eax // eax is modified
movl %edx,%ecx
movl %eax,%edi // eax is more equal to P, access violation rep
stosl
popl %edi
ret
With this one
procedure nx_fill(P: PLongword; Count: Longint; Value: Longword);
assembler;
asm
pushl %edi
movl %eax,%edi // edi <- P
movl %ecx,%eax // eax <- Value
movl %edx,%ecx // ecx <- Count
rep
stosl
popl %edi
end;the produced code is correct but now this proc can no more be used as a nested proc.
