A rough draft of a 20 bit word based computer.
I kept running out index registers, on my current 20 bit design
so revised the instruction set for 16 registers rather than 8.
Some new connections were added to the the control CPLD.
The current hardware will only support 8 registers, so a new cpu pcb
card is on order. 8 registers is ample for testings and bootstrapping.
SIMPLE 20 BIT COMPUTER ~1968 .. 1973
CARRY IS THE ONLY FLAG
8 (BASIC) OR 16 (UPGRADE) REGISTERS
~ 1.6 uS memory cycle. 18 bit memory address space + rom/system ram.
0987 6543 2109 8765 4321
+----+----+----+----+----+
|0TTT COOO DDDD SSSS ####| normal
+----+----+----+----+----+
+----+----+----+----+----+
|0TTT COOO DDDD #### ####| quick #
+----+----+----+----+----+
+----+----+----+----+----+
|0TTT ICCC DDDD .... ....| jmp condition #
+----+----+----+----+----+
+----+----+----+----+----+
|#### #### #### #### ####|
+----+----+----+----+----+
COOO = ALU FUNCTION, C = WITH CARRY
ICCC = CONDITION, I = INVERT CONDITION
DDDD = DEST REGISTER
SSSS = SOURCE OR BASE REGISTER
ALU FUNCTIONS
# normal with carry
0 ST source := R
1 ADD ADC R := R + source updates carry flag
2 SUB SUB R := R - source updates carry flag
3 CAD CAC R := source - R updates carry flag
4 AND R := R & source
5 OR R := R # source
6 XOR R := R $ source
7 LD R := source
TTT INSTRUCTION TYPE
0 CTL,BYTE IMMEDIATE
1 SHIFT AC #
2 DISPLAY AC,JMP ON CONDITION #
3 LOAD EFFECTIVE ADDRESS REGISTER OPERAND S
4 MEMORY PRE INCREMENT S
5 MEMORY POST INCREMENT S
6 MEMORY S INDEXED
7 MEMORY S INDEXED INDIRECT
The changes only require rewriting the programmable logic to work
and some free time. Most likely the weekend.
Bytes need more thought and major pcb changes.
Any ideas on the best way to do this?
I need a good high level language, but every thing wants 8 bit bytes.
I need a language that has strings rather than bytes,
and able to bootstrap a OS and later self compile as I have Bare Metal
and no software other than binary bootstrap.
Will anything still fit software wise on a vintage machine?
An interesting observation - does that mean you were looking at how application software would look, in terms of register usage?
I do like the idea of being able to compile a compiler on the machine itself. My guess at one way to do it is to be quite close to one of the early machines that had an early ALGOL port, for example, and follow that. At any given point, you could either adjust your machine to fit what the compiler needs, or adjust the compiler source to fit what your machine provides.
How about BCPL? It can use bytes but doesn’t require them. It is quite low level though, everything is really just a word. It dates from before bytes and byte addressing were commonly used.
You know I like BCPL, of-course, so would also suggest that…
But here is a thing - I use BCPL to generate it’s “optimal” bytecode, then write the bytecode interpreter in native assembly. 3 different systems so-far. that’s obviously not as fast as getting it to generate native code, but it’s very workable and portable.
What if the native assembly in your CISC system was better geared towards executing the bytecode and while creating an actual CPU to execute it directly would (I think) be very hard, (it has 2 switch opcodes for example and 2 very complex bit-select read/write opcodes) what about creating an assembly language that was more closely geared towards it?
An example.. the virtual machine has just 3 registers. Rather boringly called A, B and C. Loading a value into A pushes A into B (Not to C though, there are exchange codes for that) So an opcode to do that copy, or an internal block of logic to do that copy every time you load a value into A.
So the machine code of your system becomes a “microcode” to BCPLs bytecode, in a fashion…
You could almost execute each bytecode code directly and trap to the more complex ones…
The other thing it has to be able to do is efficiently read a byte from memory - sorry - I know you’re struggling with bytes but by the end of the 60’s they were a real thing in computing and big word machines really excelled in the scientific world more than anywhere. You can live without bytes in BCPL (it’s hard and you’ll need to re-write pack and unpack library routines as they’ve long since gone), but as it’s a bytecode system your machine code would need to read the opcode and call the handler for that in an efficient manner.
The ultimate in efficiency there is ARM32 which can do it in 2 cycles. RISC-V takes 5 cycles (or 6 in some architectures missing one of the Z extensions). 65816 takes 29 cycles…
Another issue might be that BCPL may not be really ‘retro’ as the latest compiler was released just a few months back. Martin Richards continues to work on it.
That is Plan B
I have no idea how to port the high level BCPL from 16 bits (The BCPL book)
to 20 bits.
It is no problem finding a high level language to cross compile stuff,
but the catch is I want to be able to self compile on this system.
Before the 80’s machines needed to have multi-pass compilers from mag tape.
After that you had one pass compilers like Small C,or Pascal but then you needed
a byte machine.
Plan C emulate a byte machine.
Ben.
Well the hardware is now running the new instruction set.
The architecture is from the late 60’s and early 70’s with
the design concept that a 16 bit computer can be extended to 20 bits
with little cost in hardware with MSI ttl chips now out.
BYTES are evil and from the dark side. the other Ben.
and whistle beep beep flash R2D2.
Me neither and I’ve been writing BCPL for many years now.
That book while good is now rather dated. The big question is; how are you going to compile the compiler?
Todays BCPL runs under Linux or MS Windows. The latest compiler can output code for 16/32 or 64 bit systems. Bludgeoning it to produce code for a 20-bit system? Who knows. I did enter into a very brief conversation with Martin Richards about the possibility of a 12-bit system (ie. PDP/8) I think he laughed.
My ‘retro’ system is a 16Mhz 65c816 CPU (the so-called 16-bit version of the 6502) with 512KB of RAM. It can run the compiler and compile everything (given time, it’s not fast!) but it can’t compile the current compiler. That needs too much ram. It seems even the old systems have gotten bigger and bigger over the years.
I feel your memory may be confusing you here. Go back another decade and.. maybe.
e.g. in 1978 I was using an Interdata 7/32 mini-computer which was running a multi-user operating system and myself and 4 or 5 others could edit and compile programs in Imp77 without any issues, paper tape, mag tape, or anything as archaic as that.
Similarity on a PDP-11/40 with 128KB of core running Unix 6; 4 or 5 of us were editing, compiling, running C and Pascal programs.
OS/6 written in BCPL running on a Modular 1 in 1972, while only single user, let users edit and compile to/from local store - no tapes.
Also lookup the history of EMAS which went online in 1971 and supported the computing needs of Edinburgh University at the time.
The mid-1970’s saw the microprocessor revolution - that’s when things got smaller again but even so CP/M systems had C, FORTRAN and even COBOL compilers…
The 80’s was a ball park cut off date. The PDP-11 with UNIX and the x86 with dos
set the beginning of today’s architecture.I want to play with different ideas in architecture.
8 bit bytes are too small as a computer word. 12 bits might be a better size.
In 1981 here in Canada computing science still had a IBM 1130 with punched cards.
I rather liked the IBM 1130 concept, one could even touch and see the computer.
I do plan to add bytes, but not sure how to do it.
2 8 bit bytes + 4 bits unused or two bytes of 10 bits?