News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Recent posts

#31
The Campus / Re: Way besides ExitProcess to...
Last post by Vortex - June 27, 2025, 06:09:01 AM
Hi Quan,

ExitThread : Ends only current thread.
#32
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by NoCforMe - June 27, 2025, 06:06:57 AM
Quote from: LordAdef on June 27, 2025, 05:04:23 AMWhile writing the test prog, I was moving routines around and sometimes I got "invoke" faster than "call"

You don't seem to understand what invoke actually does.
It's a macro which behaves differently depending on whether the thing being invoked has parameters or not:
  • If the subroutine has parameters (and if there is a PROTOtype defined for that routine), invoke pushes the parameters from the "outside in", then does a CALL.
  • If the subroutine has no parameters, then invoke simply does a CALL.

So in the latter case there's no difference between invoke and CALL.

invoke is not a processor opcode.
#33
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by LordAdef - June 27, 2025, 05:04:23 AM
Quote from: NoCforMe on June 25, 2025, 08:54:24 AM
Quote from: daydreamer on June 24, 2025, 11:14:15 PM
Quote from: NoCforMe on June 24, 2025, 09:00:25 PMSo it's better not to align a proc???
I thought it should be like that with Align vs unaligned  proc start,because innerloop some opcodes later ends up aligned

Excellent point; hadn't thought of that.

It's not necessarily the proc's entry point that you want aligned:
it's whatever instruction that marks the start of a time-sensitive part of the proc, a loop or whatever.
So the alignment should probably be done inside the proc, not outside.

Yep, interesting how this apparently obvious benchmark brings interesting results.

my _jmp macro aligns the jump caller and the returning one.

The _jmp is align 4, because it was my best "average" results. Aligning 16 got me better results, but not always

The other thing is how different it behaves when we move the target address within the code, or any changes we make in the prog. It seems there's not much to be done without either benchmarking the code all the time or to check the binary.

While writing the test prog, I was moving routines around and sometimes I got "invoke" faster than "call"

quick edit: I assumed NEAR jumps should give me faster results. In my machine it didn't make any difference. But... it should
#34
The Campus / Re: Way besides ExitProcess to...
Last post by NoCforMe - June 27, 2025, 02:27:51 AM
Yes, and I still don't get it: what's the problem with using ExitProcess()?
#35
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by jj2007 - June 26, 2025, 07:00:50 PM
Quote from: jj2007 on June 25, 2025, 01:14:58 AM
Quote from: daydreamer on June 25, 2025, 12:54:02 AMmysterious error,alignedinvoke.exe wont work
Just run it through Olly and tell me where it chokes. Btw no MasmBasic there, it's purest Masm32 :cool:

Daydreamer, I am still waiting...
#36
The Campus / Re: Way besides ExitProcess to...
Last post by jj2007 - June 26, 2025, 06:59:58 PM
Quote from: Quan on June 26, 2025, 12:53:28 PMReally sorry for reviving a thread from 2013

Don't worry, it's still an interesting topic. ExitProcess is a safe way out, "ret" requires that the stack is still ok - unlikely in many cases...
#37
ObjAsm / Re: New Editor
Last post by Biterider - June 26, 2025, 04:46:56 PM
Hi
Having finally conducted some performance tests, I found that the results varied considerably depending on factors such as whether or not the script had to make any changes (trimming, for example).
When scaling down the results to the same number of lines, I arrived at a factor of ~6x (on my hardware).
Considering that it is an interpreter which checks for errors in every command and for a user-initiated abort condition, this is an exceptional result.  :thumbsup:

The next step is to try other things to determine what other interface procedures are required.

Regards, Biterider
#38
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by daydreamer - June 26, 2025, 02:25:35 PM
Quote from: NoCforMe on June 25, 2025, 08:54:24 AM
Quote from: daydreamer on June 24, 2025, 11:14:15 PM
Quote from: NoCforMe on June 24, 2025, 09:00:25 PMSo it's better not to align a proc???
I thought it should be like that with Align vs unaligned  proc start,because innerloop some opcodes later ends up aligned

Excellent point; hadn't thought of that.

It's not necessarily the proc's entry point that you want aligned:
it's whatever instruction that marks the start of a time-sensitive part of the proc, a loop or whatever.
So the alignment should probably be done inside the proc, not outside.
Might wanna start thread with comparing Align 64 with a innerloop vs unaligned loop, where cpu constantly need to reload cache lines
#39
The Campus / Re: Way besides ExitProcess to...
Last post by Quan - June 26, 2025, 12:53:28 PM
Quote from: MichaelW on March 01, 2013, 06:08:45 PMAssuming that ESP has the same value that it had at entry (IOW, anything that was pushed onto the stack has been removed from the stack), you can set the return value in EAX and use RET.

Not sure if I missed anything in this thread, but, for future reference, esp AND ebp both have to be the same value at entry, just in case anyone's programme changed the value of ebp in their programme.

At least in my testing environment, [esp] points to kernel32 and [ebp] points to ntdll at entry


Nvm, I was most likely wrong and was having a problem somewhere else. Really sorry for reviving a thread from 2013
#40
Music / Very cool version of a Weather...
Last post by stoo23 - June 26, 2025, 12:00:32 AM