Assembly will never die

MrAl

Joined Jun 17, 2014
13,862
just stumbled on this thread. recalling putting together and playing with ZX81. shortly after that got spectrum 48k, and soon after that first PC (XT).
when it comes to assembly the most exciting time for me was the 90s when assembly demo scene was making big waves with visual and audio effects.
and who does not like good story like how Rob Barnaby made WordStar?
Hi,

I loved assembler because you had control over every single instruction plus every cycle time period. If you set a loop to run in 1ms, it ran in 0.001000 seconds not 0.001001 seconds. It was beautiful compared to the crazy stuff we see today. It's hard to code that though if you want multi threads and such that we seem to need today. I've done it, but it's not easy.
I remember back in the day when I worked for a company and had to code something fairly complicated in assembler. I had to make a flow chart so I could keep track of everything that was happening or could happen. It was pretty neat though. Today I think we are too lazy to do that kind of thing anymore and it does take a lot of time too, and not doing that leads to sloppy code.
 

MrAl

Joined Jun 17, 2014
13,862
Ha.

So I wonder: is this a case (i.e. FFMPEG) where assembly is actually required to achieve necessary performance metrics on a modern 64 bit processor, or are they just intellectual purists (and programming masochists)?

In any case, I'm happy they're keeping the flame alive on modern hardware.
Hi,

Oh I did not know that, but I have seen other cases where a higher level language just didn't perform well enough and I had to go lower. In a few cases, I did have to go back to asm but that was because the higher level language simply did not have the right C language calling convention needed for an implementation of COM which is a binary standard and still being used today.
Many years ago I had to use asm to create a math package because the higher level language was just too slow for things like matrixes which require lots and lots of operations to compute. That was before coprocessors came onto the scene. Today there are still advantages however especially in big number (greater than 17 digits) calculations.
 

MrChips

Joined Oct 2, 2009
35,280
That's probably because it *is* more difficult than C :)
I think everybody finds this out sooner or later.
It depends on how one was introduced to ASM. If that was all you had and you were well grounded in learning ASM then it is not difficult.

Having said that, imagine that you had to program the following:

RESULT = ( K x A[++i] - L x B[++j] ) / M x C[++k]

In C, you simply just do that.
In ASM, you would likely have to create your own multiplication and division functions and array operations.
A HLL does all the nitty-gritty stuff for you.
 

joeyd999

Joined Jun 6, 2011
6,486
That's probably because it *is* more difficult than C
Context is important.

It is far easier for me to write PIC 8 bit code in .asm than C, as I've noted many times before.

With C, one needs to rewrite and recompile repeatedly to get desired effects -- assuming desired effects are even possible without adding inline asm.
 

MrAl

Joined Jun 17, 2014
13,862
It depends on how one was introduced to ASM. If that was all you had and you were well grounded in learning ASM then it is not difficult.

Having said that, imagine that you had to program the following:

RESULT = ( K x A[++i] - L x B[++j] ) / M x C[++k]

In C, you simply just do that.
In ASM, you would likely have to create your own multiplication and division functions and array operations.
A HLL does all the nitty-gritty stuff for you.
Hi,

Am not sure what you are saying here.
If we have A and B and compare them, we can make statements about A and B. If we only have A, then we don't have anything to compare it to so how can we say that A (or B) is somehow better.

If I have a car and a truck I can say that the car is easier to drive than the truck and it rides smoother. If all I ever had was a car I can't compare it to a truck I don't have yet but the whole idea is to do a comparison.

I realize C can be difficult too sometimes though because of the extremely varied syntax.
 

MrAl

Joined Jun 17, 2014
13,862
Context is important.

It is far easier for me to write PIC 8 bit code in .asm than C, as I've noted many times before.

With C, one needs to rewrite and recompile repeatedly to get desired effects -- assuming desired effects are even possible without adding inline asm.
Hi,

Well when we make comparisons like these we usually don't consider fringe cases to be the rule.

I liked PIC coding in asm too and C takes up more room in memory usually, so there are advantages.
 
Top