An Intel 8080 assembler and online simulator

栏目: IT技术 · 发布时间: 4年前

内容简介:While going through Charles Petzold's "Code" book again, I was looking for an easy-to-use online assembler and simulator for the classicSo I ended up rolling my own, and theIf you want to play with the simulator, a live version is available online at

While going through Charles Petzold's "Code" book again, I was looking for an easy-to-use online assembler and simulator for the classic Intel 8080 CPU , but couldn't find anything that fit my needs exactly. There are some well-done tools out there, but they seem to be more geared to running game ROMs and earge programs on an emulator; my need was different - I just wanted something to play with, to practice 8080 assembly programming.

So I ended up rolling my own, and the js-8080-sim project was born. The project has three main parts:

  • An assembler for the 8080: translating assembly language code into 8080 machine code. I wrote a custom assembler for this.
  • A CPU simulator: simulating 8080 machine code. For this purpose I cloned the maly/8080js project into my repositoryand tweaked it a little bit.
  • A simple web UI for writing 8080 assembly code, running it and observing the results (as changed values in memory and registers). I wrote a basic UI in JS:
An Intel 8080 assembler and online simulator

If you want to play with the simulator, a live version is available online at https://eliben.org/js8080

The UI is purely client-side; it makes no requests and just uses your browser as a GUI. It does use the browser's local storage to save the last program you ran.

Issues and PRs on Github welcome!

On JavaScript and frameworks

Using JS for a project like this is very natural, because ultimately what I'm interested in is having a convenient web UI to play with the simulator. When I do this, I almost always end up writing vanilla HTML+CSS+JS, avoiding frameworks. I don't write JS often, so whenever I get to work on a new project, the framework do juor has typically changed from the last time, and I just don't have the time to keep track. Vanilla HTML+CSS+JS has much better longevity, IMHO, although it does mean somewhat more manual work (e.g. to keep the UI in sync with the application state).

The only framework I was tempted to use is Bootstrap for the CSS and layout, but eventually decided against it in the interest of simplicity.

We're fortunate to have much more stable and usable JS and web APIs in 2020 compared to just a few years ago. For the simulator I've been using the ES6 version of JS, which is widely supported today and offers many niceties.

I went with vendoring 8080js because it appears to be unmaintained, and I also wanted to avoid a dependency, preferring the project to be self-contained. This was easy with 8080js because it's a single JS file and it has a permissive 2-clause BSD license. I've reproduced the license in full in the cloned source file. FWIW, 8080js itself is also based on an earlier BSD-licensed simuator; OSS at its best :-)

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

你凭什么做好互联网

你凭什么做好互联网

曹政 / 中国友谊出版公司 / 2016-12 / 42.00元

为什么有人可以预见商机、超越景气,在不确定环境下表现更出色? 在规则之外,做好互联网,还有哪些关键秘诀? 当环境不给机会,你靠什么翻身? 本书为“互联网百晓生”曹政20多年互联网经验的总结,以严谨的逻辑思维分析个人与企业在互联网发展中的一些错误思想及做法,并给出正确解法。 从技术到商业如何实现,每个发展阶段需要匹配哪些能力、分解哪些目标、落实哪些策略都一一点出,并在......一起来看看 《你凭什么做好互联网》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试