flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > The big lie told by the assembly language people

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
UniverseIsASimulation



Joined: 23 Sep 2016
Posts: 10
The big lie told by the assembly language people
It's that you have to use assembly language to write drivers. You don't. In fact, as I've heard from the programmers in real life, drivers are usually written in C.
Assembly language doesn't give you superpowers. It won't give your computer ability to do what other programming languages aren't capable of making your computer do. It just gives you the ability to deal with the registers and the system stack directly, but, to do anything useful, you still have to call the C library functions or their near-equivalents (like BIOS interrupts). It certainly won't give you the ability to escape this computer simulation that people call the reality! Sorry about that!
This has to be said to the newcomers, so that they don't get disappointed as I got, when I decided to learn assembly and dedicated a lot of time to it thinking it can solve all my problems.
So, to people like me: I think that you can escape the reality using the computers, but that assembly language won't help you any more than, for example, C will.
Post 11 Nov 2016, 21:09
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1124
... and one of the many problems I can think of that assembly languages can't solve is self-delusion. Rolling Eyes
Post 11 Nov 2016, 21:37
View user's profile Send private message Reply with quote
UniverseIsASimulation



Joined: 23 Sep 2016
Posts: 10

ManOfSteel wrote:
... and one of the many problems I can think of that assembly languages can't solve is self-delusion. Rolling Eyes


Well said! Many people say that Boolean algebra helps with reasoning, and it doesn't. The world we live in is just a bunch of contradictory and contrary information. That's exactly what I would expect in a buggy computer simulation, not in the reality. Boolean algebra doesn't help here.


Last edited by UniverseIsASimulation on 12 Nov 2016, 12:21; edited 1 time in total
Post 11 Nov 2016, 21:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14463
Location: Eta Argus
It is sad that UniverseIsASimulation is wrong. There are many things you can do in assembly that cannot be done in an HLL. C compilers do not give the programmer access to all of the CPU native instructions, so in some cases you are forced to use assembly when you need those instructions. As for that being specific to drivers (or anything else for that matter), well it depends upon what you are doing, as usual. Blanket statements that claim all drivers can be written in C are plain wrong. But the opposite is true, all programs (for anything) can be written in assembly. It might not be the best option, or the fastest option, but it is always an option.
Post 11 Nov 2016, 22:17
View user's profile Send private message Visit poster's website Reply with quote
neville



Joined: 13 Jul 2008
Posts: 488
Location: New Zealand
@UiAS: your OP reads reads as if it was inspired by a programmer with some disdain for assembly language, most likely a C programmer Wink So I suspect that this is one of the programmers you've heard from "in real life" who has been influencing you.

But now you are hearing from some A programmers "in real life", and surprise, we have a different view Surprised With absolute justification!

So don't get disappointed, but dedicate lots more time to learning assembly and become a proficient A programmer too. Or alternatively, just be happy being a C programmer, and accept your limitations Cool

_________________
FAMOS - the first memory operating system
Post 12 Nov 2016, 02:32
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 127

UniverseIsASimulation wrote:
So, to people like me: I think that you can escape the reality using the computers, but that assembly language won't help you any more than, for example, C will.

I think you expect the wrong thing from assembly language (or any computer language for that matter). Assembly language is the language of the CPU. Obviously, if the CPU can't "escape reality" then you won't be able to do that with asm.

You might have more luck searching for Voodoo/Mystic or Alien CPUs. Wink Maybe then asm can help you.
Post 12 Nov 2016, 12:36
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 364
Only an idiot talks like that on a board full of seasoned C programmers, compiler writers and OS developers.
Post 12 Nov 2016, 15:37
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 766
Location: Jakarta, Indonesia
Is there any open source OS writtein 100% in HLL (C,Pascal, etc) without assembly involved?

I just randomly checked the latest Linux kernel code, and well there are some assembly codes here and there. Razz
Post 12 Nov 2016, 16:03
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2071
Location: Usono (aka, USA)

TmX wrote:
Is there any open source OS writtein 100% in HLL (C,Pascal, etc) without assembly involved?

I just randomly checked the latest Linux kernel code, and well there are some assembly codes here and there. Razz



I haven't personally checked the sources, but Project Oberon 2013 is supposedly pure Oberon (albeit using SYSTEM, which is where the non-portable, system-specific stuff goes). I'm pretty sure Wirth said he didn't need assembly, but when you have certain primitives already defined for such low-level purposes, then you shouldn't need much else.
Post 12 Nov 2016, 21:29
View user's profile Send private message Visit poster's website Reply with quote
UniverseIsASimulation



Joined: 23 Sep 2016
Posts: 10

Quote:
C compilers do not give the programmer access to all of the CPU native instructions, so in some cases you are forced to use assembly when you need those instructions.


1. A lot of those instructions, if not most of them, do little more than just crashing your program (causing Bus error or Segmentation fault). For example, HLT, calling BIOS interrupts… Except if you work in DOS or maybe some other old operating system, which you probably don't.
2. Every modern OS has an API for writing drivers in an HLL.

Quote:
Assembly language is the language of the CPU.


Exactly. But I don't think that newcomers expect that. Introduction to the book about Assembly Language I've read says that it's basically a language used with drivers and high-performance computer games which gives you access to all of the capabilities of your computer.
Post 13 Nov 2016, 08:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14463
Location: Eta Argus

UniverseIsASimulation wrote:
2. Every modern OS has an API for writing drivers in an HLL.

Are you referring to the HAL? Because that is most commonly associated with I/O access. But that doesn't allow things like vectorisation, cache control or CPU specific operations.
Post 13 Nov 2016, 21:53
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2620
Location: dank orb
No language solves problems - the programmer solves the problem and translates it into languages they understand. In some languages a problem can be solved with a single line of code, but that doesn't say anything about the problem. If you work in a group then often a language understood by the whole team needs to be used.

Where does assembly language fit in? Some might say it's a way of thinking about problems - how to break them down into parts. Some might say it's a way of thinking about the machine - letting one code better in any language. Some might say it allows them to do what can't be done in any other language. I think it's all these things and none of them. It's possible to avoid assembly language and still be a good programmer, but that's not what any of us should be here for.
Post 16 Nov 2016, 19:12
View user's profile Send private message Visit poster's website Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 138
Location: Madrid - Spain
I think that the question isn't "Why use assembly?" but "Why don't use assembly?", which has been despised many times
Post 18 Nov 2016, 11:26
View user's profile Send private message Reply with quote
TheRaven



Joined: 22 Apr 2008
Posts: 71
Location: U.S.A.

ManOfSteel wrote:
... and one of the many problems I can think of that assembly languages can't solve is self-delusion. Rolling Eyes



Agreed.

We do realize that compilers utilize a procedure similar to assembler and linkers are dead give away to the fact.

Also, C/C++ as well as Pascal (freePascal) provide access to registers and stack.

Assembler directly bypasses compiler design (proprietary) allowing un-interrupted access to various components at the hardware level including DMA if the developer wishes. ASM is limited only by the developer's understanding and not the compiler developer's interpretation of what is important.

There is no escape from the fundamental importance and existence of assembler else I would have never bothered throwing 10 years into its study. OOA, OOD and OOP are all possible in assembler as hardware is modular or object based - Von Neuman Architecture 101.

Access methods and classes are all possible and enforceable in assembler as well --whether anyone believes it or naught, all languages were designed on top of assembler to simplify development; the CPU can only understand its native op codes and that is assembler --assembler is only as important as having a CPU. All arguments to the contrary are foolish and those whom carry that fools gold are thus.

Very Happy

_________________
Nothing is so sought after and often avoided as the truth.
Post 19 Nov 2016, 19:48
View user's profile Send private message Reply with quote
petelomax



Joined: 19 Jan 2013
Posts: 2
Location: London
Assembly in general and specifically FASM is a wonderful thing and an invaluable learning tool.

The option to write what you need in low-level code is easily justifiable, and any language designer that says, of such, anything remotely like "you don't need that" should be taken out and shot, or at the very least neutered.

I am really glad that someone took the time to write FASM in FASM and make it self-hosting, but at the same time, I can accept the view that writing anything more than a few test programs in nothing-but-assembly is just plain foolish.

My world, however, would be a much sader place without hundreds of FASM examples.

For me, in all the languages I have ever used, the most important factor is time(bug->fix). Sadly, that is where FASM falters - no more than C/C++, but for all their other (nasty) flaws, PHP/Python/Java can teach them a few tricks.

Pete
(Author of Phix, a simple self-hosted hll inspired by FASM, which should have a working Linux GUI rsn [currently that is Windows-only].)
Post 26 Nov 2016, 02:27
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
Re: The big lie told by the assembly language people

UniverseIsASimulation wrote:
So, to people like me: I think that you can escape the reality using the computers, but that assembly language won't help you any more than, for example, C will.



Maybe you just had different intentions for learning assembly. I for one thought I'd become God and maybe dethrone it with my newly found Assembly skills.

But you know what? It is because of Assembly that I am able to understand computers from electrical, hardware, and software point of view. Assembly opened my eyes to the wonderful things of this world.

Especially sweet ass FASM. I dumped NASM and MASM. Razz
Post 26 Nov 2016, 11:57
View user's profile Send private message Reply with quote
El Tangas



Joined: 11 Oct 2003
Posts: 120
Location: Sunset Empire
I too, learned assembly in the hope of attaining supreme godlike power, and became disappointed. Still human Sad

But hey, on the bright side, I can use the C flag, something the C language can't do. Go figure.
Post 28 Nov 2016, 12:55
View user's profile Send private message Reply with quote
ford



Joined: 21 Jan 2010
Posts: 84
There are two major things that I would suggest we look at seriously. First, Assembly language requires that one know what he/she is actually doing. By itself this is actually quite amazing. Crappy software is a very serious threat for the modern world, and it needs more recognition. Second, Assembly does allow for more optimization than most other languages, but assembly takes more time to write. This means that you have to be conscious of the trade off: programmer time or computer time.
Post 29 Nov 2016, 01:40
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14463
Location: Eta Argus

ford wrote:
... assembly takes more time to write.

I'm not so sure this is universally accurate. Maybe for an HLL programmer jumping into assembly occasionally makes it seem that way. For an experienced assembly programmer I suggest it can be faster to write something correctly in assembly than with an HLL.
Post 29 Nov 2016, 08:24
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 127
When I first learned of assembly it dramatically improved my C language skills. Prior to that I used to think of pointers as abstract arrows, which was a pain to visualize. Now they are nothing more than an index into memory for me. Obviously I had no idea how memory indexing/addressing actually worked before.

In my opinion HLLs are quite bad for beginners and I know from experience. It's fine to abstract things when you don't want to bother with details, but it's not a good way to learn and form a real understanding of what you're doing.

No wonder so much software is full of stupid bugs these days and people even think they are doing good while relying on a "garbage collector"... because they were never taught the difference.
Post 29 Nov 2016, 15:45
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.