Author Topic: Procedure not requiring automatic register saves  (Read 165 times)

Offline TemPiQ

  • New Member
  • Posts: 1
Procedure not requiring automatic register saves
« 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
« Last Edit: April 13, 2019, 10:01:15 PM by TemPiQ »

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2364
  • Country: us
Re: Procedure not requiring automatic register saves
« Reply #1 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