lmichaelis / computer-simulation Goto Github PK
View Code? Open in Web Editor NEWA simulation of Ben Eater's breadboard computer which can run assembly code
License: GNU General Public License v3.0
A simulation of Ben Eater's breadboard computer which can run assembly code
License: GNU General Public License v3.0
I have some other suggestions I was thinking of looking at too:
Add decimal output
class _OUTInstruction(_Instruction):
def process(self, computer):
print('[OUT] %s - %03d' % (computer._a, int(computer._a, 2))) # include decimal in output
computer._pc += 1
def get_basename(self) -> str:
return 'OUT'
Looks like negatives are not handled correctly. But maybe I am still having to learn more about binary.
This program should load 10 into A, subtract 20 from A and output -10 (11110110 in twos compliment)
➜ Computer-Simulation git:(temp) ✗ cat negative.prg
LDA 15
SUB 14
OUT 0
HLT 0
14: 20
15: 10
but when I compile and run this, I get:
➜ Computer-Simulation git:(temp) ✗ ./cpu.py negative.prg.bin
Loglevel: INFO
[OUT] 11111111 - 255
It works perfectly in cases where the result of the SUB call is > 0.
I will see if there is anything I can do to sort that out. It will mean learning how you structured your code a bit more. But it might be fun...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.