Micro code as therapy

A small package with a tiny silicon chip and enough complexity to occupy a senior nerd

Not yet being compost my grey matter likes exercise. The website offers some. There’s the drawing. The writing, both prose and the other stuff. Projects in the back yard. I finally put that kiwi plant into weed Valhalla. My resolve to build the tiny house weakens, flickers then flares up again. As the old saying goes, the spirit is willing but the flesh is almost three quarters of a century old. Then there is the microcomputer, A tiny chip of silicon mounted to a little metal frame and molded into a small plastic package. There are eight connections, power takes two, the inputs and outputs use the other six. That part is pretty simple. The complexity, the challenge to understanding, is etched in the thin bit of Monocrystalline silicon. Not pure silicon, rather a perfectly controlled impure form, a semiconductor. Even in small quantity the microcomputer costs about a dollar. For that buck one gets a machine that can execute a couple million instructions per second. There are thirty odd instructions to learn, not that many. In fact this type of machine is known for not having too many instructions. Some microcomputers have a hundred, several hundred with possible all possible variations.

This is where the microcode meets the physical world. Where lights blink and resistors resist.

Being retro by nature I of course use a computer language so dated I doubt its taught anymore, except as an ancient artifact, like Latin among human language. The list of discarded computer languages is long and growing. This language is called Assembly. It scripts what I want the machine to do. The script is called a source file. A program called, the “Assembler”, assembles the source file into a form that can be “flashed” into the microcomputer’s memory. Same sort of flash memory in a thumb drive, but far fewer bytes. Thousands of vs billions. It might take me an hour to write a section of code that will run in a millisecond. The Assembler’s biggest job is pointing out my errors. There is a saying, “no code has no error”, true of released code, code out in the world. It is especially true of fresh code. So writing software code even at this simple “bit banging” level involves finding and fixing errors in the script. Compared to human language assembly is very simple. Some really smart people are working to write software that can parse human written text and find errors. But, human language though finite, is orders of magnitude more involved. Not finding any errors doesn’t mean microcode will do what was intended. As with a page of text in English, it might be grammatically correct with nothing misspelled – yet be pure meaningless drivel. My favorite in Assembly is goto $. It means, goto the address you are at now and execute the instruction you find there. That instruction is the one it just carried out. The little computer doesn’t get frustrated even though it is chasing its own tail. But this line of code is useful as a safety device, a trap. Areas of memory that should never be accessed can be filled with such traps. If the machine gets confused and points to a trap, like an errant fly on sticky paper, its held there, it can’t stumble elsewhere and do damage.

Its just another crossword puzzle, solitary card game, collection of mugs or stamps or butterflies. Its something to do. Even before the Corona thing eliminated my useless trips as diversion, I messed with the microcomputers. Distraction. Solutions to a high class problem, not needing to struggle to survive.

Published by glensketch

Retired from electronics industry. Ex USN ex USAF ex expat in Ecuador.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: