Page 1 of 2

Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 8:47 am
by trident
...

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 9:15 am
by Schol-R-LEA
I'm not certain if I am following you, quite, nor do I fully see the relevance of the digression about Kermit, but as far as OS dev is concerned, there are and probably always will be some parts of an operating system that will need to be written in assembly. The amount absolutely necessary is rather small, but it is there, especially if you choose to write your own boot loader. The majority of an OS can be written in a high-level language, however (for suitable values of 'high-level'; see the Languages page of the wiki for the requirements of a language applicable to OS dev).

OTOH, if you are talking about Mel Kaye style hex coding rather than using an assembler to do the heavy lifting... frankly, it is almost unheard of today, and for good reason. You can do it if you'd like, but don't be surprised if you end up in an asylum gibbering about Elder Gods and the stars aligning...

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 9:22 am
by trident
...

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 9:23 am
by Schol-R-LEA
trident wrote:
Schol-R-LEA wrote:I'm not certain if I am following you, quite, nor do I fully see the relevance of the digression about Kermit, but as far as OS dev is concerned, there are and probably always will be some parts of an operating system that will need to be written in assembly. The amount absolutely necessary is rather small, but it is there, especially if you choose to write your own boot loader. The majority of an OS can be written in a high-level language, however (for suitable values of 'high-level'; see the Languages page of the wiki for the requirements of a language applicable to OS dev).
Schol-R-LEA, is necessary develop currently in hex code and the other encodings that I asked?
Almost never. Even most OS developers will never have to do it unless they choose to.

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 9:33 am
by trident
...

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 9:46 am
by trident
...

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 10:24 am
by Schol-R-LEA
I think understanding the binary coding can be very useful, sure, so lessons in it make a certain amount of sense. However, actually doing significant work in it generally is more effort than is justifiable for the results, and likely to lead to frustration (insanity isn't actually likely, though it might seem so after a few days of it).

As for an assembler not supporting some opcodes... well, it can happen, with very new versions of a processor or a very old assembler, I suppose, but I've never run into such a situation myself. OTOH, I'm in the process of writing my own assembler, so that does put a different spin on things for me.

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 10:30 am
by mathematician
trident wrote:Sorry, I forgot to ask you something.

I heard say that nobody writes in binary, the lowest you could go is hexadecimal. Most CPUs take hexcodes and turn them into binary directly, they've been doing that for decades. But everyone uses Assembly because writing in hexadecimal directly is insane.

Is truth that nobody writes in binary, the lowest you could go is hex code? :wink:
It is almost never the case that anybody codes directly in hex, and still less binary. The only very rare exception occurs if you want to do something the assembler won't. You usually encounter an example of that if you are using masm to write a second stage loader.

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 10:50 am
by Schol-R-LEA
trident wrote:Sorry, I forgot to ask you something.

I heard say that nobody writes in binary, the lowest you could go is hexadecimal. Most CPUs take hexcodes and turn them into binary directly, they've been doing that for decades.
The CPUs don't, but the debuggers, disassemblers, loaders, and other software that access that level of programming directly generally will. It is possible to access the binary level, but... why would you?

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 2:32 pm
by trident
...

Re: Is necessary develop currently in Assembly...?

Posted: Sat Nov 29, 2014 2:54 pm
by konacake
I'm sorry if this is off topic but this guy really confuses me. He's everywhere, I've seen him on Phoronix forums, ReactOS forums, and the FreeBSD forums. Everywhere he goes he asks the same thing and gets the same answer. At first I thought he was a spambot.

To be on topic, as I said on the ReactOS forums, there are no practical reasons to use binary/hex, even assembly isn't very practical in most cases, but if you want to do it as a hobby sure, you can even wire up your own processor as a hobby if you want. Actually I was doing that in a program called Logisim. Hell, forge your own metals, silicon and porcelain and make your own computer, you can go as low-level as you want. But I think more importantly, what is it about this answer that you aren't satisfied with? Do you want to use hex/binary that badly? You can you know, nobody's stopping you. Hell, pick up a copy of Intel's x86 manual, that's an excellent start for that.

So OP, where are you going to ask this next? :roll:

Is necessary develop currently in Assembly, ..., hex code?

Posted: Wed Dec 03, 2014 6:25 pm
by trident
...

Re: Is necessary develop currently in Assembly, ..., hex cod

Posted: Wed Dec 03, 2014 7:05 pm
by mathematician
Unfortunately, your English isn't all that it could be. But I will try my best:

a.) Microcode is a language which the processor uses internally. The only people who ever encounter it are programmers who work for processor manufacturers, such as Intel.

b.) Nobody, except perhaps one or two eccentrics, programs in hex or binary.

c.) Assembly language tends not to be very much used nowadays, although it cannot be completely avoided if you are writing an operating system.

d.) C tends to be the language of choice to operating system development.

Re: Is necessary develop currently in Assembly, ..., hex cod

Posted: Thu Dec 04, 2014 12:14 am
by no92
mathematician wrote:c.) Assembly language tends not to be very much used nowadays, although it cannot be completely avoided if you are writing an operating system.
Source? I'd say Assembly is used by many programmers. You need it for things like heavy code optimization, shellcoding and compilerDeving. That's not just a little part; it's a big one. Some c-only programmers don't need it, but still know it.

As soon as you start to program on a arch other than IA-32(e), you will run into trouble with your C compiler. For example, there's no good C compiler for Zilogs (ask the KnightOS guys if you don't believe what I'm saying).

Re: Is necessary develop currently in Assembly, ..., hex cod

Posted: Thu Dec 04, 2014 2:51 am
by Kevin
I think you're heavily overestimating the number of kernel and compiler developers. And even of those, only the platform-specific core code and the code generator actually require writing some lines of assembly. That's a rather small part of a complete OS or compiler, and still most of it isn't in assembly.

The truth is that C is already too low-level for most people who write some kind of code, and that I've met only few people whose code got better instead of worse when they "optimised" it by rewriting in assembly. Let's not even start talking about the maintainability and error-proneness of assembly code. For a good low-level C programmer, assembly is mostly read-only: Occasionally (not really hoften) reading the compiler output while debugging something.

With respect to other platforms: About any serious platform has a C compiler. Have a look at the arch/ directory of my Linux source tree (hint: it's written in C):

Code: Select all

$ ls arch/
alpha  arm    avr32     c6x   frv      ia64     m32r  metag       mips     openrisc  powerpc  score  sparc  um         x86
arc    arm64  blackfin  cris  hexagon  Kconfig  m68k  microblaze  mn10300  parisc    s390     sh     tile   unicore32  xtensa
I see 28 non-x86 architectures there.