ASM is easier than believed

Programming, for all ages and all languages.
User avatar
~
Member
Member
Posts: 1226
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

ASM is easier than believed

Post by ~ »

It looks like programming purely in assembly is easier than using the GCC, linker and makefile stuff.

I see that people who use compilers too often have more problems than what should be acceptable, or maybe it only happens to uneducated compiler users.

But still so, it looks like using assembly is easier than using a compiler, whenever one has a clear design ready to be programmed and given one has at least 2 years of intensive assembly programming training.

Portability wouldn't be a problem because one would only need to reprogram the design we would already have properly documented so we don't forget not even the smaller details.

Assembly is incredibly easy as opposed to popular belief, and any program can be made to run even with a pure raw binary format, without the need to use a complicated linker, only a structured directory tree in a unified include file and a very few external objects.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Re: ASM is easier than believed

Post by Alboin »

~ wrote:It looks like programming purely in assembly is easier than using the GCC, linker and makefile stuff.
I agree. That is, for osdev.
~ wrote:Portability wouldn't be a problem because one would only need to reprogram the design we would already have properly documented so we don't forget not even the smaller details.
Different systems have different instruction types; You would need to adjust the entire source to whatever system you were porting to.
~ wrote:Assembly is incredibly easy as opposed to popular belief, and any program can be made to run even with a pure raw binary format, without the need to use a complicated linker, only a structured directory tree in a unified include file and a very few external objects.
Often, however, I do believe that it is difficult to maintain. Moreover, it is often more easy to program something in a high level language than in assembly.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
~
Member
Member
Posts: 1226
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Post by ~ »

Why hard to maintain, if it should be easier once the actual program is coded?

And for the ease of a higher level language, doesn't it seem logical that assembly would be virtually as easy as them if one uses things like heavy documentation and not start programming until the design of a piece of code is complete as well as using C-like pseudocode?
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

so basically you want to do the compiler's job yourself. Yeah sure go ahead, you'll probably end up with a small, lean, fast, and efficient program that works better than c. But then again if you are already IN a kernel like linux then doing stuff can be pretty hard considering you have to do all that syscall stuff before you can even think about writing a program that actually *does* something.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: ASM is easier than believed

Post by Solar »

~ wrote:But still so, it looks like using assembly is easier than using a compiler...
Strongly depending on your definition of "easy", and the scope of what you are programming. The standard libraries of high-level languages relieve you of much manual labor. Point in case are C++ <string>, <vector> and <algorithm>.

But that is not really the point, and you could write quite capable "standard" libraries for ASM, too.

The point is that, even with a single CPU family, what is "good" ASM changes over time, so what might have been efficient code once is sub-par today. Even worse when you ever have to switch to another CPU family. With high-level languages, you can recompile and be done with it. With ASM, you have to invest countless man-hours re-writing, re-testing and re-debugging your code, reverse-engineering your documentation in the process because no documentation is ever good enough to re-write an application with any amount of ease.

At least none I have ever seen.

And if you work in a team, there is the issue of finding qualified people. You will find C / C++ / Java / Perl / ... coders a dime a dozen. But professional grade ASM coders? Erm, for which CPU, please?

ASM looks very easy for those with a strong "techie" streak. But while I can talk someone from my business department through a piece of C++ no problem, with ASM it gets a lot harder...
Every good solution is obvious once you've found it.
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

I was reading a book on books24x7.com (my college gives each student a subscription), and there was a chapter in an introduction to assembly book about object oriented programming. It was an interesting read.
My OS is Perception.
ehird
Member
Member
Posts: 214
Joined: Thu Mar 15, 2007 8:48 am

Post by ehird »

Assembly for low level hardware-related stuff is more maintainable, because it's what Assembly is designed for.

For a music player? A GUI? A shell? Er, no.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

I think theres some equilibrium point for asm to be easier. Compare it to car engines: Petrol engines (=asm) are cheaper, common and easy. Diesel engines (= C) are more complex beasts, yet more powerful and consume less to the mile, with an additional penalty of having to pay more tax. If you dont drive much the petrol engine is the object of choice, whereas if you drive 50 miles a day you quickly earn back the expense of buying a more powerful engine.

To complete the analogy, ASM programs are easier when little code is involved, while C and higher level languages are easier when you have to spend quite a bit of time on it.

.02$
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Post by XCHG »

Combuster wrote:Diesel engines (= C) are more complex beasts, yet more powerful
I totaly disagree with that :!:
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

XCHG wrote:
Combuster wrote:Diesel engines (= C) are more complex beasts, yet more powerful
I totaly disagree with that :!:
you might disagree, but to no avail because it is true.
Author of COBOS
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Post by XCHG »

Okay if coders create "powerful" programs with C which is a "beast", then in Assembly, you create the "beast".

When comparing entity A to B and stating that for example, entity B is more powerful than entity A, it only holds true as long as there is something that entity B can do but A can not and you might try finding such situation, but "to no avail" of course. :wink:
Last edited by XCHG on Wed Mar 21, 2007 9:59 am, edited 1 time in total.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Can even use used cooking oil on Diesel engines, granted it's not the most fuel efficient approach.. It's apparently a poor mans solution ;)

http://www.google.ca/search?hl=en&q=use ... arch&meta=
http://en.wikipedia.org/wiki/Straight_vegetable_oil

Although there are legal implications in some places: Read Here
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Post by bubach »

In what sense could C possibly be more powerful then assembly? It might have many other good sides, but nothing is more powerful then pure asm.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

bubach wrote:In what sense could C possibly be more powerful then assembly? It might have many other good sides, but nothing is more powerful then pure asm.
You're partially correct.. Only ASM can't offer the portabillity & distribution C can..

It is very possible to be a powerful C programmer for a multitude of architectures and Operating Systems..

Alternatively you can be powerful ASM programmer for a handful of specific architectures..
Depending on how many instruction sets you learn..
And how many OS specific syscalls you decide to learn.. ;)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

Brynet-Inc wrote:And how many OS specific syscalls you decide to learn.. ;)
I think that's the major assembly killer. Many systems don't make their calls actively available, and you have to rely on linking to their libraries causing more system dependence. Moreover, calling their libraries in anything but C or C++ might be near impossible in assembly.
C8H10N4O2 | #446691 | Trust the nodes.
Post Reply