Forum > Beginners
intel assembly code
marcov:
Try adding "nostackframe" modifier
tormods:
tried to put the current unit including the function in delphi mode, it seems that the calling unit also need to be in delphi mode does this mean that a complete application all units need to be in delphi mode to make this work or can units not called without stackframe still be in lazarus/fpc mode.
for me it is no issue to convert all my assembly routines originally written for delphi to pure pascal, it is therefore important to know how fpc works at assembly level.
thank you all for answers
tormods
Leledumbo:
--- Quote --- tried to put the current unit including the function in delphi mode, it seems that the calling unit also need to be in delphi mode does this mean that a complete application all units need to be in delphi mode to make this work or can units not called without stackframe still be in lazarus/fpc mode.
--- End quote ---
again, check the generated assembly for both callee and caller and see the difference yourself. One of the compiler switches and/or calling convention might be the cause.
marcov:
If I add nostackframe, no stackframe is generated in $mode objfpc:
function __SkrUtilCheckInRange(Low,High,Val : integer) : boolean; assembler; nostackframe;
(rest the same)
compiling with -a gives
--- Code: ---section .text.n_p$program_$$___skrutilcheckinrange$longint$longint$longint$$boolean,"x"
.balign 16,0x90
.globl P$PROGRAM_$$___SKRUTILCHECKINRANGE$LONGINT$LONGINT$LONGINT$$BOOLEAN
P$PROGRAM_$$___SKRUTILCHECKINRANGE$LONGINT$LONGINT$LONGINT$$BOOLEAN:
cmpl %edx,%ecx
ja .Lj5
cmpl %eax,%ecx
jb .Lj5
movl $1,%eax
ret
.Lj5:
xorl %eax,%eax
ret
--- End code ---
in the corresponding .s
Navigation
[0] Message Index
[*] Previous page