A project log for SANX-I MICROCOMPUTER

Design, programming & implementation.

Javier Piay PomboJavier Piay Pombo 07/26/2019 at 00:120 Comments

I designed and successfully implemented a new Instruction Set Architecture (ISA) for the SANX-I CPU.

In the previous and original ISA, the memory address of the data/address to be read or written is formed by adding F0 (1111 0000) to the instruction operand (lowest 4 bits), so the RAM memory address space for data and jump addresses is limited to the last 16 bytes (from F0 to FF).

Whilst 16 bytes of RAM memory storage is enough to write programs intended to learn and understand how microcomputers work, get you started with machine language programming (using hexadecimal numbers or bytecodes, not assembly language) as well as to create interesting and cool coding projects (some examples are available on the SANX-I YouTube playlist), I realized 240 bytes (from 00 to EF) was too large a storage for instructions, leading to an underused memory in most cases.

The new ISA allows utilization of the whole RAM memory (256 bytes) for storing both instructions and data, like in a pure von Neumann architecture.

Its implementation requires just a slight modification, if compared with the original ISA, consisting of adding a new 4-bit register (IOH) and a new 8-bit instruction (F9) -recall that the original ISA still allows six extra instructions, from F9 to FE.

In SANX-I original ISA, the high nibble of the data address is set either to 1 or to 0.

The new instruction F9 copies the low nibble of the accumulator into register IOH. This nibble, along with the low nibble corresponding to the operand of the next instruction copied into the 8-bit IOL register will form the new memory address to be used in the second step of the machine cycle (fetch data/address and execute instruction). As you’ve probably already noticed, loading first the accumulator with the value 0F and then executing instruction F9 turns the new ISA into the previous and original one.

IOH register included in the new ISA.

A very useful application of this new ISA is the utilization of the memory to store different programs (each one with its own space for instructions and data/addresses). The image below shows a utility program template that creates three consecutive blocks in memory to write such programs. When the utility program starts, the user can select which program to run by pressing an input key in the microcomputer trainer. In this template, the three programs output its number (1, 2 or 3).