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

#21
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by jj2007 - June 27, 2025, 10:42:23 PM
Quote from: NoCforMe on June 27, 2025, 06:06:57 AMYou don't seem to understand what invoke actually does.

I'm sure he does.
#22
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by TimoVJL - June 27, 2025, 07:11:52 PM
CPU cache suffers long jumps too ?
Also call flush cache ?
#23
UASM Assembler Development / Re: Linux users, please
Last post by LordAdef - June 27, 2025, 12:38:21 PM
Quote from: mabdelouahab on June 22, 2025, 05:28:53 AMhi LordAdef
I'm excited about the project, even if my time is limited. Where do you suggest we begin?
welcome aboard mabdelouahab!! I will PM you.

Alex
#24
The Campus / Re: Way besides ExitProcess to...
Last post by NoCforMe - June 27, 2025, 09:34:25 AM
Looks like you answered a question nobody asked.
#25
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.
#26
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.
#27
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
#28
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()?
#29
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...
#30
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...