!push eax
!push ecx
!push edx
!pop edx
!pop ecx
!pop eax
is faster than
!pushad
!popad
, believe me.
Debug register
Trond=true.
Proof(No debugger!):
Proof(No debugger!):
Code: Select all
Delay(1000)
avg=0
For a=1 To 10
start=GetTickCount_()
For i=1 To 99999999
!push eax
!push ecx
!push edx
!pop edx
!pop ecx
!pop eax
Next i
stop=GetTickCount_()
avg+stop-start
Next a
MessageRequester("Average for multiple pop-pushs",Str(avg/10))
;NExt!
Delay(1000)
avg=0
For a=1 To 10
start=GetTickCount_()
For i=1 To 99999999
!pushad
!popad
Next i
stop=GetTickCount_()
avg+stop-start
Next a
MessageRequester("Average for pushad-popad",Str(avg/10))
shh.. what the users dont notice they dont mind..!Fred wrote:BTW, you push only 3 registers while PUSHAD push 8 registers.. not very fair speed test.
After the small correction (mind you, its again trond

Time to dig up my head, and an assembler manual..;
Theory:
Pushad takes 18 clock cykles, popad takes 24.
One single push takes 2, and a pop takes 4. 2*8+4*8 = 48 clock cykles in total, wich is more than 42 (18+24). But if you only need those registers the 3 push and pops is faster of course..