Page 1 of 4

ASM is easier than believed

Posted: Mon Mar 19, 2007 6:56 pm
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.

Re: ASM is easier than believed

Posted: Mon Mar 19, 2007 7:08 pm
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.

Posted: Mon Mar 19, 2007 7:54 pm
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?

Posted: Mon Mar 19, 2007 10:30 pm
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.

Re: ASM is easier than believed

Posted: Tue Mar 20, 2007 2:00 am
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...

Posted: Tue Mar 20, 2007 4:48 am
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.

Posted: Tue Mar 20, 2007 7:57 am
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.

Posted: Tue Mar 20, 2007 8:13 am
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$

Posted: Wed Mar 21, 2007 5:16 am
by XCHG
Combuster wrote:Diesel engines (= C) are more complex beasts, yet more powerful
I totaly disagree with that :!:

Posted: Wed Mar 21, 2007 7:57 am
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.

Posted: Wed Mar 21, 2007 9:57 am
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:

Posted: Wed Mar 21, 2007 9:59 am
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

Posted: Wed Mar 21, 2007 11:07 am
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.

Posted: Wed Mar 21, 2007 12:42 pm
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.. ;)

Posted: Wed Mar 21, 2007 1:07 pm
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.