In what ways the assembly language can help us?
Re: In what ways the assembly language can help us?
Is it possible to add GUI in assembly language?
Re: In what ways the assembly language can help us?
It's possible to write any program a computer is capable of executing in assembly. It just takes more effort than it's worth most of the time.
Those who understand Unix are doomed to copy it, poorly.
Re: In what ways the assembly language can help us?
They hide it, if you don't want to see it. I don't know why it should be forbidden to be visible if necessary.Casm wrote:Because that is not what high level languages do. The whole point of them is to use high level instructions which hide (and are not tied to) the underlying hardware.I don't see the point why access to CPU control registers, I/O ports* or the creation of interrupt handlers should actually be impossible in all high level languages.
GCC is free software, so of course I do have control if I really badly want to.Casm wrote:The compiler emits whatever the compiler writer decided it should emit. Unless you are the person who wrote the code generator, you have no control over that.That's the point. Since everything becomes assembly, your compiler is theoretically capable of emitting every assembly code you could also write yourself.JAAman wrote:ultimately everything becomes assembly
I don't see how that relates to my argument you've cited.Casm wrote:A "high level" language which could do every thing you can do in assembly language would almost by definition not be a high level language. It would at least have to be some kind of strange hybrid.And this, on the other hand, is wrong. Of course there can. There is no fundamental reason to restrict a compiler to emit only arithmetic-logical and branching instructions.JAAman wrote:in other languages, you are not directly controlling the CPU, you are controlling the logic, therefore there can be nothing inherently in the language that can directly control the CPU...
As I've pointed out, there actually is a way to access CPU registers with GCC (without inline assembly, although the “asm” keyword is indeed reused). GCC however only allows access to the GPRs, so access of CR3 is forbidden there. I guess it'd be pretty easy to change that, though.
I have a hard time understanding that a language can't be both high and low level at the same time (the hybrid you mentioned). If it can abstract the whole “low level” stuff, it is high level. If it doesn't, it is low level, obviously. In pure C (read: C without abusing undefined constructs), I'm stuck at high level (with a pretty “basic” set of functionality). In assembly, I'm stuck at low level. What's the problem with having languages that allow you to access low level stuff in a high level manner and not having to deal with that low level if you don't need to?
I do see your point if you forbid the existence of such languages. I however don't see why they should be forbidden.
Re: In what ways the assembly language can help us?
They are implementation defined, not undefined. Otherwise we'd be in big trouble.XanClic wrote:This is already ignoring the fact that most of us (if not all) are horribly abusing C/C++ already by doing basically completely undefined pointer operations (ever casted an integer to a pointer that wasn't created by casting a pointer to an integer?).
Glad that you already found on your own how the gcc syntax for binding variables to registers works, that would have been my second comment.
Re: In what ways the assembly language can help us?
Oh, yes, you're right. I'll take back the “horribly”, then.Kevin wrote:They are implementation defined, not undefined. Otherwise we'd be in big trouble.XanClic wrote:This is already ignoring the fact that most of us (if not all) are horribly abusing C/C++ already by doing basically completely undefined pointer operations (ever casted an integer to a pointer that wasn't created by casting a pointer to an integer?).
This doesn't change my point, though: Then we're not using undefined C but rather implementation-defined C. I do have to amend one of my previous statements:
The fact that access to the whole address space through casting arbitrary integers to pointers is not undefined shows that C is in fact such a hybrid language (at least to me).XanClic wrote:What's the problem with having languages that allow you to access low level stuff in a high level manner and not having to deal with that low level if you don't need to?
Re: In what ways the assembly language can help us?
Your experience is showing againm12 wrote:Here's a comprehensive list:IdiotOS wrote:In what ways Assembly Language can specially help us to make an operating system ,when comparing to other programming languages like c,c++..?
For example: Controlling fan speed,data handling...
Other than that
Re: In what ways the assembly language can help us?
Then you'll have a hard time finding any natively compiled language that isn't.XanClic wrote:The fact that access to the whole address space through casting arbitrary integers to pointers is not undefined shows that C is in fact such a hybrid language (at least to me).
Re: In what ways the assembly language can help us?
Why would I bother? I said I don't see why such languages shouldn't exist and, in fact, I like such “hybrid” languages.Kevin wrote:Then you'll have a hard time finding any natively compiled language that isn't.XanClic wrote:The fact that access to the whole address space through casting arbitrary integers to pointers is not undefined shows that C is in fact such a hybrid language (at least to me).
Re: In what ways the assembly language can help us?
Just saying. A category like "hybrid language" loses its meaning when all languages are part of the category.
-
- Member
- Posts: 100
- Joined: Wed Mar 13, 2013 2:27 am
Re: In what ways the assembly language can help us?
It's true most compiled language have some kind of 'low level' functionality; but often languages that attempt to create a higher level interface have little or no low level capabilities because the creators see no need to incorporate them. So in this sense there aren't as many "hybrid" languages as it seems at first glance.Kevin wrote:Just saying. A category like "hybrid language" loses its meaning when all languages are part of the category.
i.e. Simply having the ability to do inline assembly would not qualify a language to be a low/high level hybrid.
TachyonOS - Violates causality on 95% of attempts. Runs at approximately 1.5c.
Re: In what ways the assembly language can help us?
I agree with this in the same way that javascript and html are not the same language, even though they're typically embedded in one another.Prochamber wrote:It's true most compiled language have some kind of 'low level' functionality; but often languages that attempt to create a higher level interface have little or no low level capabilities because the creators see no need to incorporate them. So in this sense there aren't as many "hybrid" languages as it seems at first glance.Kevin wrote:Just saying. A category like "hybrid language" loses its meaning when all languages are part of the category.
i.e. Simply having the ability to do inline assembly would not qualify a language to be a low/high level hybrid.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
If you're new, check this out.