Page 1 of 1
The 323: A 32-bit computer
Posted: December 31st, 2024, 2:10 pm
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.)
Re: 323
Posted: December 31st, 2024, 3:11 pm
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.
Re: 323
Posted: December 31st, 2024, 3:28 pm
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.
Re: 323
Posted: December 31st, 2024, 4:34 pm
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.
Re: The 323: A 32-bit computer
Posted: January 19th, 2025, 12:01 pm
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/
Re: The 323: A 32-bit computer
Posted: January 19th, 2025, 12:23 pm
by Anivec
I think the next computer up is a 64-86x architecture computer (that’s what I want to see at least).
Re: The 323: A 32-bit computer
Posted: January 19th, 2025, 6:02 pm
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.
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.
Re: The 323: A 32-bit computer
Posted: April 10th, 2025, 4:15 am
by Yoel
Extremely impressive!
How do you make the display visible in Golly though?
Re: The 323: A 32-bit computer
Posted: April 10th, 2025, 4:25 am
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).
Re: The 323: A 32-bit computer
Posted: April 10th, 2025, 4:37 am
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.
Re: The 323: A 32-bit computer
Posted: April 3rd, 2026, 8:06 am
by blah
The 323's documentation, as well as some other things like the intro video, are now available
on my website.