Intel asm compiled in unusual way under Mac OS X (i386)
Original Reporter info from Mantis: Filuta Vitaliy
-
Reporter name: FVI
Original Reporter info from Mantis: Filuta Vitaliy
- Reporter name: FVI
Description:
I got asm procedure:
procedure FillMem64(var Ptr; Count: PtrInt; const Value: UInt64);
asm
CMP EDX, 16
JL @SmallFill
//some code
//my exit point
LEAVE
RET 8
//some code
end;
content of .s file, compiled undex windows (i386)
CORE_MEMORY_FILLMEM64formal
LONGINT$QWORD:
# Temps allocated between ebp+0 and ebp+0 # [3936] end; pushl %ebp movl %esp,%ebp # Var Ptr located in register eax # Var Count located in register edx # Var Value located at ebp+8 # [3085] CMP EDX, 16 cmpl $16,%edx # [3086] JL @SmallFill jl .Lj129
//some code
//my exit point
# [3177] LEAVE
leave
# [3178] RET 8
ret $8
//some code
.Lj130:
leave
ret $8
content of .s file, compiled undex mac os x (i386)
_CORE_MEMORY_FILLMEM64$formal$LONGINT$QWORD: # Temps allocated between ebp+0 and ebp+0 .stabs "/Volumes/programming/units_new/anvil_core/core_memory.pas",132,0,0,Lf18 Lf18: .stabd 68,0,3936 # [3936] end; pushl %ebp movl %esp,%ebp subl $8,%esp # Var Ptr located in register eax # Var Count located in register edx # Var Value located at ebp+8 .stabd 68,0,3085 # [3085] CMP EDX, 16 cmpl $16,%edx .stabd 68,0,3086 # [3086] JL @SmallFill jl Lj119
//some code
//my exit point
# [3293] LEAVE
leave
.stabd 68,0,3294
# [3294] RET 8
ret $8
//some code
Lj136:
.stabd 68,0,3936
leave
ret
This difference (instructions subl $8,%esp ... ret, in place of ret 8) makes
impossible of writing asm code with exit point in it.
Mantis conversion info:
- Mantis ID: 18052
- OS: Mac OS X
- OS Build: 10.5.7
- Build: ?
- Platform: i386
- Version: 2.5.1