Monday, June 18, 2012

F and C Bits

Introduction

This essay started as a brief introduction to some of the weird things I have seen on assembly languages through the ages.  Then the essay turned into a search for documentation of the F and C bits for the SEL computers from a long, long time ago.  I needed a shell loop to fetch some files with wget and things unfolded.

I found an old manual which someone kindly scanned and placed online for the SEL 32/70 CPU.  I did some fairly interesting work with a "desktop" model, the 32/27.  It was advertised as being in a small box (when boxes were much bigger).  It had cards which I believe were 19 inches wide and slid nicely in a cabinet with the bus running vertically in the back of the cabinet.


I got to looking for more pdf's of old computers.  I think I have the instruction set definitions for every computer I have ever written assembly language at my disposal.  Try this bash command out

for d in varian sel interdata prime
do
    wget -r http://www.bitsavers.org/pdf/$d
done

I start out teaching about stupid F and C bits and got distracted by the stupid Internet.  The Internet has grown so much that it is becoming almost a living entity.  It might very well qualify as being the first bionic brain.  It is a composite brain composed of nearly every brain on earth at your disposal should you pose an interesting problem.

Still it is quite on track to discuss how to download multiple hierarchies of  remote files consisting of some of the strange computers I have used.

Back to the SEL "maxi-box".  You would slide cards (19 by 20 something inches) into the box to change things.  The 32/27 consisted of only a few cards.   The CPU was 1 card and the one I worked with had 4 memory cards for a grand total of 1 megabyte of RAM.  The SelBUS was capable of a massive 26.67 MB/sec data transfer.

The designers of the CPU had a few strange ideas.  Some ideas were OK like having 8 general purpose registers.  The instruction set was a little too simple with direct addressing of only 512KB of RAM.  It did have a set of 16 memory mapping registers which would allow programs to be mapped to higher addresses though still limited to 512KB of total memory in a process.

The memory referencing instructions held a 19 bit address in the rightmost 19 bits.  However the rightmost 2 bits were referred to as the C bits.  They, along with another bit - the F bit, controlled what type of reference was to be done.  If the F bit was a 1 the memory reference was a byte reference.  If the F bit was a 0, then the C bits selected from 32 bits (00), 16 bits left half (01), 64 bits (10) or 16 bits right half (11). 

There was a 3 bit register field in the instruction, a 2 bit index register field and a bit for selecting indirect referencing.  The indirect addressing was a bit strange.  The memory word referenced could have its indirect bit set making it a doubly indirect reference.  In fact this could go on and on.

It would seem more appropriate to incorporate the F bit and the indirect bit as part of the instruction field, making an 8 bit instruction field.  Coping with F and C bits was a strange ordeal  on a strange computer.  Fortunately the number of instructions was less than 256 which made the computer far simpler than the x86-64 computers common today.   Also the registers were quite general purpose which simplified programming some.  The registers were accessed by number which seems obviously superior than having special purpose registers with special names.

Overall I would rate the SEL instruction set as moderately crude for the time with warts - 4 out of 10.


No comments: