Author Topic: Assembly, a complete waste of time?  (Read 1067 times)

Vortex

  • Member
  • *****
  • Posts: 2457
Re: Assembly, a complete waste of time?
« Reply #15 on: September 21, 2020, 09:59:00 PM »
Inline 64-bit support for C\C++ is limited. It appears that only MinGW64 has this feature.

daydreamer

  • Member
  • *****
  • Posts: 1422
  • building nextdoor
Re: Assembly, a complete waste of time?
« Reply #16 on: September 21, 2020, 11:50:58 PM »
It has a specific command to turn high level register optimisation off so you can use all of the available registers. You still need to observe the Intel ABI but it allows mixing of simple assembler with high level code. For more complicated procedures it is better to put the code into a separate function or if its overhead critical a specialised procedure called a FASTPROC where you write your own entry/exit code.
I read long ago advice against inline asm,because it breaks compilers own way of optimize
maybe possible a inline asm snippet,where I had no problem of using all registers dont get that fast because C compiler for example might have lots of pushs ahead of you inline asm snippet and lots of pops afterwards,so calling that PROC in a loop that has inlineasm becomes little slower than the asm snippet you see

but reading asm files produced by a compiler makes use alot of esp register for local arrays,so maybe thats a coding style to use also esp as array pointers than the usual 3 registers inside PROC?

Showcase :
With Masm sdk and 2-3 hours = a windows program :D
Beat that C zealots p:

Vortex

  • Member
  • *****
  • Posts: 2457
Re: Assembly, a complete waste of time?
« Reply #17 on: September 22, 2020, 12:47:17 AM »
Hi daydreamer,

Quote
but reading asm files produced by a compiler makes use alot of esp register for local arrays,so maybe thats a coding style to use also esp as array pointers than the usual 3 registers inside PROC?

I think it depends. The compiler can also use the non-volatile registers esi,edi and ebx.