Next (small) Step Towards Humans: Assembly Language

Sorry, this was supposed to be published last year after the LMC posts.

Even with the simplified LRC computer, programming with just the number commands gets tedious very quickly.  Sure, you start to recognize 901 as input, 360 as store what is in the A register (actually a copy) into memory location 60, etc.

However, if the program is more than a few steps, it is very hard to “see” the logic.  The worst is that if you leave out a step and put it in later, you must move all of the following code down a step and change all of the branch references.  No fun.  The whole process is very mistake prone — even for super-stars.

The first step in humanizing is to write the program using words and symbolic references.  INP replaces 901, STA 60 replaces 360 and even better, STA TEMP means store what’s in the A register in a location named TEMP, that is one of the 100 locations that the computer will know TEMP refers to. In 99.999% of the time you don’t really care where the data is stored, once the program starts working on it.  You only are concerned with the input data and the output (results) data.

Of course, the computer has no clue what IMP, STA, and other symbols  mean, so you must have a program, called an assembler, that actually reads these letters and assembles (i.e.,converts) them to proper machine language. (thus the clever name, “Assembly Language”)

Peter’s LMC simulator does this nicely.  You can see the translation from letters to numbers — and what mailboxes the assembler decides to assign the symbolic references.  Confusing?  This video will show you how it works.

Print Friendly, PDF & Email