The 323: A 32-bit computer

For discussion of specific patterns or specific families of patterns in Conway's Game of Life, both newly-discovered and well-known.
Post Reply
User avatar
blah
Posts: 324
Joined: April 9th, 2016, 7:22 pm

The 323: A 32-bit computer

Post by blah »

Happy new year.

Have a CPU. I provide it here with documentation, as well as an assembler script that runs in Golly and some example programs.

(Edited to provide context.)
Attachments
323.tar.gz
(7.04 MiB) Downloaded 275 times
Last edited by blah on December 31st, 2024, 5:50 pm, edited 1 time in total.
succ
User avatar
LuveelVoom
Posts: 577
Joined: April 27th, 2022, 7:59 pm

Re: 323

Post by LuveelVoom »

What is this file? There’s no description, for all we know it could be a virus. Please tell us what this actually is.
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: 323

Post by confocaloid »

It's just an archive (.tar.gz), and not a "virus". It's definitely CGoL-related, and there seems to be documentation inside.
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
hkoenig
Posts: 299
Joined: June 20th, 2009, 11:40 am

Re: 323

Post by hkoenig »

Postings like this need to have descriptions attached describing the contents and why someone would want to download and unpack it.

Update 2025-01-01: Thank you for adding the description.
Rei
Posts: 10
Joined: September 12th, 2020, 7:56 am
Contact:

Re: The 323: A 32-bit computer

Post by Rei »

This is a great project!

I found some issues in the documentation. The opcode for st xX,xY should be aYX0. Also the opcodes for jf and jnf are swapped. The last byte of jf should be 2 and jnf should be 1.

I created an emulator that can be used in a browser.
https://rei1024.github.io/323-web-emulator/
User avatar
Anivec
Posts: 1995
Joined: January 28th, 2022, 7:18 pm
Location: In 4.3 miles, take a right onto Exit 54

Re: The 323: A 32-bit computer

Post by Anivec »

I think the next computer up is a 64-86x architecture computer (that’s what I want to see at least).
User avatar
blah
Posts: 324
Joined: April 9th, 2016, 7:22 pm

Re: The 323: A 32-bit computer

Post by blah »

Rei wrote: January 19th, 2025, 12:01 pm I found some issues in the documentation. The opcode for st xX,xY should be aYX0. Also the opcodes for jf and jnf are swapped. The last byte of jf should be 2 and jnf should be 1.
Thank you for the corrections. At some point whilst I was working on the 323, I swapped the mnemonics for jf and jnf around, and when I wrote the opcode table I referenced an old file that hadn't been updated. I have attached a fixed version of the main.html file below (I don't think the changes are enough to warrant re-doing the whole tar-ball). I suppose trying to use documentation to implement something is the ultimate test of its correctness; any mistakes will inevitably (probably) be caught.

Also, you mean nybble, not byte.
Rei wrote: January 19th, 2025, 12:01 pm I created an emulator that can be used in a browser.
https://rei1024.github.io/323-web-emulator/
This made my day! This is the first time someone other than me has written an emulator for a CPU I designed. It even has breakpoints.

Edit: I see you even wrote a .3ss (323 save state) decoder, which I guess you had to reverse engineer since I never bothered to publically document that format. For convenience, here's a comment from my C emulator that describes the format (I guess you already mostly figured this out, but better late than never):

Code: Select all

/* Save-state (.3ss) format:
	3 BYTES: ASCII '323'.
	BYTE: 23.
	BYTE: Flag (only LSB is used; all other bits are cleared).
	WORD: Program counter.
	15 WORDS: Registers (x1 first, xF last; value in xF is as read, not as
	          written; i.e. if the last instruction was "xor x0,x0,xF", xF
	          will be -1).
	4 TIMES:
		16 WORDS: Cache line; hwords are converted to words in little-
		          endian style.
	4 WORDS: Addresses that those cache lines correspond to; lower 5 bits
	         cleared. They indicate the lowest address in the cache line.
	BYTE: Cache order. Consists of 4 groups of 2 bits which refer to a
	      cache line. The rightmost group indicates the most recently used
	      one, and the leftmost is the LRU. The cache lines are numbered in
	      the order in which they appear in the save-state.
	WORD: Amount of RAM words saved in this save-state. If 0, this is the
	      end of the save-state.
	AMOUNT OF WORDS SPECIFIED BY PREVIOUS: RAM.

	Overall, the non-RAM section is 346 bytes.
*/
I also have a script, save-state.lua, that generates a .3ss file by reading the value of the machine. It only works in thl, though, and it'd probably be complicated to convert it to work in Golly.

Edit 2 (2025-01-25): My "fixed" version of main.html still says that "st xC,x0" assembles to 0xac00. It should be 0xa0c0.
Attachments
main.html.gz
This should go in the same directory as the old main.html.
(30.3 KiB) Downloaded 123 times
succ
Yoel
Posts: 463
Joined: July 2nd, 2020, 1:02 am
Location: Electronic jungle
Contact:

Re: The 323: A 32-bit computer

Post by Yoel »

Extremely impressive!

How do you make the display visible in Golly though?
Yoel
Posts: 463
Joined: July 2nd, 2020, 1:02 am
Location: Electronic jungle
Contact:

Re: The 323: A 32-bit computer

Post by Yoel »

That would be a truly masochistic endeavor. 86x is one of the most awkward CISC architectures in existence. ARM, SPARC, RISC-V, MIPS, Alpha are much better designed. Being popular does not necessarily mean good. The same applies to OSes. If someone would try to implement a modern OS in a CA, that would be some version of Unix/Linux, not WIndows (notoriously weirdly and badly designed), would it?
Anivec wrote: January 19th, 2025, 12:23 pm I think the next computer up is a 64-86x architecture computer (that’s what I want to see at least).
User avatar
blah
Posts: 324
Joined: April 9th, 2016, 7:22 pm

Re: The 323: A 32-bit computer

Post by blah »

Yoel wrote: April 10th, 2025, 4:15 am Extremely impressive!

How do you make the display visible in Golly though?
You don't need to do anything special; it's just cells. You just need to pan/zoom Golly's view to fit it in the window with the right zoom level. At the left of the machine is a component that repeats 16 times going in a line downwards; this is the I/O system. On the left of that line are some peripherals, surrounded by eaters to make it clear where they begin and end. The largest peripheral is the display; on the left-middle of it is the 32x32 screen itself. At the right zoom level, each pixel of the display is a 2x2 of pixels on your actual screen.

Also, when you run the machine, make sure you run the script at t=0, otherwise the display's contents will be garbled.
succ
User avatar
blah
Posts: 324
Joined: April 9th, 2016, 7:22 pm

Re: The 323: A 32-bit computer

Post by blah »

The 323's documentation, as well as some other things like the intro video, are now available on my website.
succ
Post Reply