NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: TemPiQ on April 13, 2019, 08:48:36 PM

Title: Procedure not requiring automatic register saves
Post by: TemPiQ on April 13, 2019, 08:48:36 PM
Please forgive me if this question has been asked already.
I have sought in the forum for some time now without success.

I  need a procedure that does not require automatic register saves or will not access the register spill area.
That means no need to use the EBP register

However if I code somthing like this:
Code: [Select]
proc Sample1
    RDTSC
    MOV DWORD[EDI],EAX
    MOV EAX,EDI
    RETN
endproc

nasm will compile as follows:
Code: [Select]
Sample1:
    PUSH EBP
    MOV EBP,ESP
    RDTSC
    MOV DWORD[EDI],EAX
    MOV EAX,EDI
    RETN

Thanks

@Frank Kotler:
Sorry I forgot the "endproc" which I have included now in the edited post
Title: Re: Procedure not requiring automatic register saves
Post by: Frank Kotler on April 13, 2019, 09:46:23 PM
"proc"? What is "proc"? Not Nasm.  Whatever it is, you probably want to get  rid of it, since it is apparently generating code you don't want.

Best,
Frank