TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Comp Mark II: Simple 4-bit/1 Hz Virtual Computer

34 点作者 jsnathan超过 9 年前

3 条评论

userbinator超过 9 年前
The architecture looks simple enough, but when I saw the source...<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gto76&#x2F;comp-m2&#x2F;tree&#x2F;master&#x2F;src" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gto76&#x2F;comp-m2&#x2F;tree&#x2F;master&#x2F;src</a><p>...that&#x27;s quite a bit more code than I was expecting.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gto76&#x2F;comp-m2&#x2F;blob&#x2F;master&#x2F;src&#x2F;specific_instruction.hpp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gto76&#x2F;comp-m2&#x2F;blob&#x2F;master&#x2F;src&#x2F;specific_in...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;gto76&#x2F;comp-m2&#x2F;blob&#x2F;master&#x2F;src&#x2F;specific_instruction.cpp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gto76&#x2F;comp-m2&#x2F;blob&#x2F;master&#x2F;src&#x2F;specific_in...</a><p>IMHO this is a good example of how OOP can obfuscate. Over a dozen classes, all almost the same. This could easily be condensed into a single lookup table.<p>For comparison, here is a complete 8086 emulator, and it also includes some code to emulate other hardware of the PC:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;adriancable&#x2F;8086tiny&#x2F;blob&#x2F;master&#x2F;8086tiny.c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;adriancable&#x2F;8086tiny&#x2F;blob&#x2F;master&#x2F;8086tiny...</a>
评论 #10327431 未加载
评论 #10327680 未加载
Narishma超过 9 年前
That looks to be an 8-bit CPU. It has an 8-bit accumulator and instructions are encoded in 8-bits. The only 4-bit thing in there is the address space, but even that is really 2*4-bits.
cbd1984超过 9 年前
I wonder why the Makefile builds everything with -O0
评论 #10327681 未加载