Wednesday, 17 September 2014

Re: The coding in binary code and assembly is necessary currently?

On Wed, Sep 10, 2014 at 05:32:22PM -0300, françai s wrote:
> The coding in binary code, in other words, machine code is necessary currently?
>
> The coding in assembly is necessary currently?

To a good first approximation: no.

Occasionally boot loader and kernel developers need to do so, and the
odd bit of optimised code needs to drop down to assembly, usually via
GCC's inline assembler instructions. It is rare. In ten years of
working on Ubuntu (including a considerable amount of time working on
GRUB) I've maybe spent as much as a month in total thinking about
assembly code, and I doubt I've written more than a few hundred lines of
it.

By lines of code, the GRUB boot loader currently contains about 4%
assembly; less than that if you're only looking at code built on a
single given architecture. It's only needed for things like the startup
sequence, bits of symbol relocation, firmware calls, that kind of thing.
When you can avoid assembly, using it is a complete waste of effort and
time is much better spent getting up to the point where you can write
portable C code or higher as quickly as possible. Modern optimising
compilers will probably produce faster code anyway unless you're a
wizard prepared to spend a lot of time hand-optimising a very small
amount of code.

In userspace, I would be surprised to find any assembly code outside of
optimised routines in libc, OpenSSL, maybe some multimedia software,
that kind of thing; and in those cases there would normally need to be a
dual version in a higher-level language for portability.

> One person told me that there are three or more years ago the
> University of Latvia and Riga Technical University taught code in
> binary.
>
> I like both this subject that is irresistible to me.
>
> I say this because about three years ago the Riga Technical University
> and University of Latvia continued teaching coding in binary code, in
> other words, machine language.

Gunnar's reply to you on debian-devel seems quite sensible here:

https://lists.debian.org/debian-devel/2014/09/msg00392.html

--
Colin Watson [cjwatson@ubuntu.com]

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel