gto76/comp-cpp được TopGit xếp vào nhóm dự án mã nguồn mở, với 343 sao trên GitHub, viết chủ yếu bằng C++. Comp Mark I – Simple 4-bit virtual computer
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Execution stops when program reaches last address (15).
Whatever gets written to the last address is sent to the printer.
When reading from the last address (15), we get a random byte value.
CPU has one 8 bit register.
Instruction set
READ ---- - Copies the value at the specified address into register.
WRITE ---* - Copies value of the register to the specified address.
ADD --*- - Adds value at the specified address to the value of the register, and writes result to the register. If the result is bigger than the maximum possible value (255 = ********) then 255 gets written.
SUBTRACT --** - Subtracts value at the speicfied address from the value of the register, and writes result to the register. If the result is smaller than 0 then 0 gets written.
JUMP -*-- - Changes the value of the program counter to the specified address, meaning that in the next cycle execution will continue at that address.
IF MAX -*-* - Jumps to the specified address if register has value 255 = ********.
IF MIN -**- - Jumps to the specified address if register has value 0 = --------.
SHIFT R -*** - Moves every bit of the register one spot to the right. This way rightmost bit gets lost, and a leftmost becomes '-'. This is the only instruction that doesn't use the address part, making the last four bits irrelevant.
Any instruction that is not defined above is interpreted as READ ---- instruction.
How to run on…
Windows
Install Tiny Core Linux on VirtualBox using this instructions.
Run the UNIX commands.
UNIX
$ git clone https://github.com/gto76/comp-cpp.git
$ cd comp-cpp
$ ./run
Other versions
Mark II, model with separate address space for code and data, and with more instructions. Programs can be saved and loaded and it can run without the interface (instead of a printer, it then uses stdout). Also input can be piped in.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/gto76/comp-cpp là nguồn chính thức.
gto76/comp-cpp có bao nhiêu sao?
gto76/comp-cpp có 343 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/gto76/comp-cpp. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
gto76/comp-cpp có những chủ đề gì?
GitHub topics của gto76/comp-cpp: "educational-software", "virtual-machine". TopGit xếp repo vào nhóm mã nguồn mở.
gto76/comp-cpp còn đang phát triển không?
Commit gần nhất trên gto76/comp-cpp là 2.7 năm trước (theo timestamp GitHub). Repo có 32 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
gto76/comp-cpp viết bằng ngôn ngữ gì?
gto76/comp-cpp chủ yếu viết bằng C++. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc comp-cpp có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về comp-cpp.