Categories
assembly Night’s

Assembly Nights

Over the last three months, I’ve developed an unusual little nighttime routine: after reading bedtime stories to the kids, I hop into bed and instead of reaching for a fiction book, I’m turning on my 14-year old Asus eeePC 701 miniature laptop and writing x86 assembly language. This is turning out to be an insanely…

Reading bedtime stories to my children, I jump into bed instead of reaching for the books.
a fiction book, I’m turning on my 14-year old
Asus eeePC 701 miniature laptop
and writing x86 assembly language. This is turning into an amazing method.
Use of my time…

My faithful asus eeepc 701 waiting romantically on the bed

My faithful eeePC 701 is a 32 bit Celeron “netbook” mini-laptop from 2007
Alpine Linux is currently being used. You can see it here editing my very early days.
Work-in-progress NASM port for “JonesForth” This tiny computer has been used for more
There are more versions of Linux than I can count. It’s also warm even on a cold night.

My interest in the Zig program language sparked a deeper interest and fascination with “systems-level programming” which, in the end, leads to computer architecture, instruction sets and assembly languages.

Learning environment

For reasons I don’t understand, it just feels right for me to use my small computer with
Its tiny keyboard allows you to type small instructions at night. It stands, I think.
It stands to reason that I might feel completely different from my normal environment.
Desktop development machines put me into a receptive learning mindset.

I also installed it.
Lynx,
This is not the best machine to use for Web 2.0.
surfing, except for ratfactor.com It’s quite a beautiful thing.
distraction-free device.

This little computer is only used for one thing, so I’ve been slowly
customizing it for this one task: when I log in, my .bash_profile script
immediately does a cd to my assembly project directory.

I have many little cryptic scripts of one and two letters and aliases.
Open my project in Vim and all related documentation. Or, start the GDB Debugger
Run a GDB script that has a breakpoint.

These little things make it easier for me to get moving when I’m tired.
Feeling like I’m putting in a lot of effort. Now, I feel like I need to grab the eeePC.
Logging in and opening the assembly project are automatic. It’s like brushing my teeth.
teeth.

So, what’s the project I’m working?

Porting JonesForth

Immediately after you have completed the lessons on asmtutor.com. (See NASM under
Below are the resources. I immediately started on one of my “bucket-list” projects.
Shelved for many moons: Reading and understanding Richard WM Jones’s books
JONESFORTH.

But I didn’t stop there. I decided to translate it to NASM.

The progress has been slow since I am new to assembly in general
NASM in particular. JonesForth was written in GAS (the GNU Assembler), with a
Completely different syntax. Even machine instruction mnemonics can be completely different.
Different because GAS often includes data size
Part of the mnemonic.

The biggest challenge in the beginning was to port some critical macros from GAS into NASM.
Each one was complex and took several weeks to comprehend.

But, it’s quite amazing and satisfying to work on something other than trivial.
even if it started way over my head. This has been a struggle for me.
It’s been hard at times but I keep going and it keeps getting easier.
way. Each time I find a new instruction or fix a bug it’s a success.
Little triumph.

This section is an update:

I “accidentally” set a deadline for the JonesForth port in recent days. I
Want to complete a few of the small projects I have accumulated for myself.
Year so I can focus more singularly on a few larger ones going into the
Next year. You know what happened when I met that deadline? I
I started to rush through the JonesForth blocks, trying to convert them as fast as possible.
As fast as I could, I went to NASM. Stupid, right?

I knew that I needed to slow down. It’s not an easy task. A
It is easy to feel a sense of urgency, but it is not difficult to lose.

My “shower epiphany” last evening (this was days after I wrote this original).
article) was about how to slow down. Here it is: I’m going stop
Fix any syntax mistakes so that the thing assembles.
and then walk through every single instruction I’ve got so far and make sure
It all works as it should. To make it even more enjoyable, you can actually have
To give you an indication of my efforts, I will log the entire thing
session. I don’t even own X on this computer so the obvious choice is for
Logging is GNU Screen, the terminal multiplexer.

My initial thought was “Oh great! Now I need to learn another tool!”
Completely sidetracked!

Then my second thought was, hold on, that is great. Now I know what to do.
Another big, ubiquitous GNU program properly and have an additional tool I’m
confident using. Screen is a great tool for all types of tasks.
Convenience improvements: At the moment, I am using Linux’s virtual terminals
(Alt-F1, Alt-F2, etc.) Vim and GDB sessions are both available.
It is easy to refer to. These are my responsibility. Screen makes it easy to manage them manually.
You can automate both the opening and closing of each item with one command.
toggle between them with Screen’s Ctrl-a, Ctrl-a.

So I’m curre

Read More

Leave a Reply

Your email address will not be published.