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

Biterider

  • Member
  • ****
  • Posts: 545
  • ObjAsm Developer
    • ObjAsm

jj2007

  • Member
  • *****
  • Posts: 10644
  • Assembler is fun ;-)
    • MasmBasic
Re: Assembly, a complete waste of time?
« Reply #1 on: August 16, 2020, 08:34:58 PM »
It's difficult to beat C, but we try anyway...

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Assembly, a complete waste of time?
« Reply #2 on: September 19, 2020, 09:20:16 AM »
 :biggrin:

> It's difficult to beat C, but we try anyway...

Arrrrgh, no ambition.  :tongue:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TimoVJL

  • Member
  • ****
  • Posts: 562
Re: Assembly, a complete waste of time?
« Reply #3 on: September 20, 2020, 02:15:44 AM »
C isn't hard to learn, but this site is for an assembly :biggrin:
For me the C is important, my current contracts require to give sources too and i work for a manufacturing.
My current joy is working with oracle and dwg-files :thumbsup:
PS: my longest running program have run since 2003 and needs Windows 95, as a laser COM component need that OS to work with  a dongle.
« Last Edit: September 20, 2020, 12:59:42 PM by TimoVJL »
May the source be with you

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Assembly, a complete waste of time?
« Reply #4 on: September 20, 2020, 03:42:22 AM »
C as a language is an industrial workhorse that is generally fit for purpose if written correctly where assembler tends to be more specialised and usually pointed at areas where speed matters. There is overlap in capacities, C can do a lot of low level stuff if you know how to write it where assembler can do a lot of high level stuff if you are familiar with it.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

Siekmanski

  • Member
  • *****
  • Posts: 2365
Re: Assembly, a complete waste of time?
« Reply #5 on: September 20, 2020, 05:15:17 AM »
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.
Creative coders use backward thinking techniques as a strategy.

felipe

  • Member
  • *****
  • Posts: 1336
  • Eagles are just great!
Re: Assembly, a complete waste of time?
« Reply #6 on: September 20, 2020, 08:54:07 AM »
Those who know assembly cannot be fooled with computer sh*ts like sofware engineering, high level, commerce biassed concepts... :tongue:

Felipe.

Vortex

  • Member
  • *****
  • Posts: 2372
Re: Assembly, a complete waste of time?
« Reply #7 on: September 20, 2020, 06:47:41 PM »
Assembly can be useful for High Level Language coders to study the code produced by the optimization engine of a compiler. About C, it can be a good couple with assembly. Speed critical code can be moved to an assembly module.

TimoVJL

  • Member
  • ****
  • Posts: 562
Re: Assembly, a complete waste of time?
« Reply #8 on: September 20, 2020, 11:19:53 PM »
Assembly can be useful for High Level Language coders to study the code produced by the optimization engine of a compiler. About C, it can be a good couple with assembly. Speed critical code can be moved to an assembly module.
right way to do things.
May the source be with you

daydreamer

  • Member
  • *****
  • Posts: 1384
  • building nextdoor
Re: Assembly, a complete waste of time?
« Reply #9 on: September 21, 2020, 03:12:10 AM »
Assembly can be useful for High Level Language coders to study the code produced by the optimization engine of a compiler. About C, it can be a good couple with assembly. Speed critical code can be moved to an assembly module.
right way to do things.
I have tried inline assembly,its compromise of C and ASM can be distrasous bugs,when you except "What you see is what you get",so if you want complete control ,assembly module is necesary,bugs I experienced come from C compiler like to insert padding different types in a structure,so variable x,y,z,w followed in .data section isnt guaranteed to fetch with a movups XMM0,x you want to load xyzw in register but C unexpected inserts padding,even if I learned C's alignas(16) version of align 16
whats your opinion on the new intrinsic long typed version of for example SSE?wrong way?unatural to short-type C?

also my opinion is to try to have modern coding,a workerthread in C calls the assembly proc,so you dont get a freezed GUI
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

Vortex

  • Member
  • *****
  • Posts: 2372
Re: Assembly, a complete waste of time?
« Reply #10 on: September 21, 2020, 03:41:52 AM »
Hi daydreamer,

Probably, the inline code interfered with the code generator of the compiler. The best method is to move all the assembly code to a separate module.

daydreamer

  • Member
  • *****
  • Posts: 1384
  • building nextdoor
Re: Assembly, a complete waste of time?
« Reply #11 on: September 21, 2020, 05:18:25 AM »
Hi daydreamer,

Probably, the inline code interfered with the code generator of the compiler. The best method is to move all the assembly code to a separate module.
I already practice much making separate many asm modules,I think its the best way to make a big masm32 windows program,but like many here prefer asm with its macros making winapi easy to write asm,so once you made your module there is freedom to call it from different languages
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

Adamanteus

  • Member
  • **
  • Posts: 235
    • LLC "AMS"
Re: Assembly, a complete waste of time?
« Reply #12 on: September 21, 2020, 06:11:04 AM »
I'm thinking, that assembler compatibility with other languages is goal of it.
And asm-coder ought be ever ready to cooperate with any other coder.
When it's becames skill – us nobody will run ...

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Assembly, a complete waste of time?
« Reply #13 on: September 21, 2020, 09:51:02 AM »
Mixing high level language and assembler is simply practice and you must well understand what the high level language does. I have for years done my simpler stuff in PowerBASIC because it has a decent inline assembler and the compiler was written by an assembler language programmer.

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.

You could run inline assembler in 32 bit VC but the 64 bit version needs MASM to construct modules that you link into a C/C++ app. I don't keep up on the wider range of C compilers but I know Pelle's C compiler comes with an accessory assembler POASM and I know that the GNU C compiler comes with GAS so if you bother, you can write fast assembler for most C compilers.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

Adamanteus

  • Member
  • **
  • Posts: 235
    • LLC "AMS"
Re: Assembly, a complete waste of time?
« Reply #14 on: September 21, 2020, 05:16:00 PM »
 And skill will appear itself, when client saying : for advertising purpose, is need to make SLOWPROC from you  hand-optimized code, and it must from inside debugger, look the same as code produced by his compiler – for you know, to where ticked you bought with assembler  :dazzled:
 So assembly could be, a complete waste of time ...