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

Vortex

  • Member
  • *****
  • Posts: 2560
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: 1644
  • 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?

SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

Vortex

  • Member
  • *****
  • Posts: 2560
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.

daydreamer

  • Member
  • *****
  • Posts: 1644
  • building nextdoor
Re: Assembly, a complete waste of time?
« Reply #18 on: April 21, 2021, 07:18:50 PM »
Assembly is still important to the industry.
Smaller code fits in cheaper microcontrollers with less ram and saves a lot of money in mass production.
maybe the someone said '640K is more memory than anyone will ever need.',maybe he had assembly programmers in mind at the time?
because not seen many exceptions to small sized asm programs,except you use big libraries,3d many k polys 3dmodels with hires textures ,video files,sound files included
« Last Edit: April 21, 2021, 11:48:06 PM by daydreamer »
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

Biterider

  • Member
  • ****
  • Posts: 705
  • ObjAsm Developer
    • ObjAsm
Re: Assembly, a complete waste of time?
« Reply #19 on: April 21, 2021, 08:04:56 PM »
Hi
Here are the latest Tiobe stats!
As far as I can remember, I have never seen assembly in 8th place in this ranking  :thumbsup:

Biterider

daydreamer

  • Member
  • *****
  • Posts: 1644
  • building nextdoor
Re: Assembly, a complete waste of time?
« Reply #20 on: April 21, 2021, 10:57:32 PM »
Hi
Here are the latest Tiobe stats!
As far as I can remember, I have never seen assembly in 8th place in this ranking  :thumbsup:

Biterider
great :thumbsup:
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

jj2007

  • Member
  • *****
  • Posts: 11481
  • Assembler is fun ;-)
    • MasmBasic
Re: Assembly, a complete waste of time?
« Reply #21 on: April 21, 2021, 11:47:18 PM »
As far as I can remember, I have never seen assembly in 8th place in this ranking  :thumbsup:

I love it :greensml:

quarantined

  • Regular Member
  • *
  • Posts: 22
Re: Assembly, a complete waste of time?
« Reply #22 on: April 22, 2021, 05:01:25 AM »
As far as I can remember, I have never seen assembly in 8th place in this ranking  :thumbsup:


 :greenclp:

xanatose

  • Member
  • ***
  • Posts: 411
Re: Assembly, a complete waste of time?
« Reply #23 on: May 19, 2021, 08:45:30 AM »
Learning assembly also gives you an inside on how to structure your code to run faster.

Sometimes a best in paper algorithm ends up being too slow due to cache concerns. If all you knew was a higher level language you would be perplexed without a way to fix the problem.





hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8368
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Assembly, a complete waste of time?
« Reply #24 on: May 19, 2021, 09:43:34 AM »
For the little it is worth, if you want to use the assembler output from a C compiler, turn OFF all of the optimisation first so you get a fully UNoptimised output as this gives you enough registers and reduction of obscurity to be able to manually optimise the assembler code. Its not a simple task but if you bother you can usually beat the compiler optimised output in performance terms.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: