Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Digital Logic Sim

​A minimalistic digital logic simulator · By Sebastian Lague

Computer and Compiler in Digital Logic Sim

A topic by BaconLogic created 45 days ago Views: 426 Replies: 8
Viewing posts 1 to 3
(+1)

I made an 8-Bit computer based off of the 6502. It has 256 Bytes of memory, excluding the stack, A,X and Y registers and RGB display.
I made a compiler for it modified from my 6502 Emulator but for this new instruction set and binary output, repository linked Here. The compiler is web based and can be found Here. Note that all projects are on one global database so please use the honor system. In the video I ran 2 simple programs to plot non-linear growing numbers and a  simple movement system. A link to download the project files is also attached Here

Enjoy, BaconLogic

Wow your project is very impressive
But i have a few question
Because you said "based off of the 6502 " why your register have a special logic ? (A register in mos 6502 have only 1  output connected to ALU and 3 input 8 bit data SB/ADD (Super Bus / Arithmetic Data Dowland ) and 0/ADD (0 [00000000] /Arithmetic Data Dowland )) but your A register have INC (I don``t have idea ) mode , DEC ( i think is decimal mode) .
Your ALU have only adder and inverter for subtract  ,  don`t have a decimal , and or shift right modes but probably You don`t need this yet

your "Compute " block I think is "Random Control Logic"

Your "Stack" module is very well done but is different from Stack pointer Register from mos 6502 (don`t have second output and your is connected directly to data bus I see )

Be honest You make a great project =D

When I said based off of 6502 I was just aiming for it to be able work like one, my only comparison is what you can do  with the assembly code, I am rather clueless when it comes to the real 6502 architecture. As for INC and DEC those are short for increment and decrement, which are used on the X and Y registers. as for bitwise operations and shifts , you are correct those have not been implemented yet.

Ohh I see =D
Because i try make a replica of mos 6502 , and when I saw  your project I was frighten XD (that I thought you overtake me)

About INC and DEC , if I good understood your reply IND make n+1 , DEC n-1 logic , yes ?

yes inc takes the value and adds 1 dec does -1

Is there a compiler written on C++?

It you are talking about a complier that takes cpp and makes it into binary, no cpp is just to high level for my computer.

No, I mean a compiler that turns assembly into machine code. It's on the web, but I want a Windows version thats written using C++.

No, unfortunately I only made it in js so that I could use it on any computer easily,  if you really don't want to use the website you could try to port it yourself if you know enough javaScript.