Nasm

0 0 votes
Article Rating

Did you know that NASM can be built from source with just GCC compiled? Look at the source here: https://www.nasm.us/

Click on the version number, then look for the.. files with “source code” as a comment. After you’ve extracted the source code, jump into the new directory and type this in:

Bash
sudo ./configure
Bash

After that finishes, type this in:

Bash
sudo make -j16
Bash

where the number 16 is how many threads your computer has, (most computers have 2 threads per core, so double the amount of cores you have.. you can see how many threads/cores with the system monitor. Most computers have a system monitor installed)

Now that takes like 3 seconds on my computer, and afterwards one more command to run to install the product:

Bash
sudo make install
Bash

now, at your terminal, you can type in nasm myfile.nasm

Assembly is pretty hard to do, but it’s so cool because it’s super small and what’s even cooler about assembly is it’s speed. The programs written in assembly are so fast, they are like, real fast.

For some reason nasm has builds for redhat enterprise linux, but not for debian/ubuntu… SO if you’re on alma linux, CentOS, rocky linux, fedora, or RHEL, you can just download without having to build it.

Building from the source code is much cooler, it is what we are all about.

So imagine this, this is a list of things you can build from source, were you sitting on an Ubuntu based system:

Bash
binutils
gcc
llvm/clang
nasm
Bash

And you could build nasm last, so it receives all those benefits of a bootstrapped compiler, that is you bootstrap llvm/clang and gcc, then build nasm, it will be like a super nasm or something.

What else could you build from source? I guess like, half of the software out there is open source, but what do you benefit from having a super fast like… GIMP? I don’t know, I don’t really see the benefit, it’s already fast enough.

But programs like llvm/clang, bootstrapping them, it seems to provide benefits all around, as it is the basis for everything on your system.

Once you have mastered building one thing, the rest, that use the make system anyway, fall into place because they all follow the config/build/install pattern. They all can be made with the same few commands. Like as you see above, nasm is build with those commands as well, configure, make -j16, and make install.

admin
Author: admin

0 0 votes
Article Rating

You may also like...

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x