/i8080-js

Join GitHub today

GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.

Sign up

Intel 8080 (KR580VM80A) core model in JavaScript
JavaScriptC
Switch branches/tags
Nothing to show
Nothing to show
Clone or download

Clone with HTTPS

Use Git or checkout with SVN using the web URL.

Launching GitHub Desktop...

If nothing happens,download GitHub Desktop and try again.

Launching GitHub Desktop...

If nothing happens,download GitHub Desktop and try again.

Launching Xcode...

If nothing happens,download Xcode and try again.

Launching Visual Studio...

If nothing happens,download the GitHub extension for Visual Studio and try again.

Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
asmInitial revision.Oct 4, 2012
filesInitial revision.Oct 4, 2012
MakefileAdd support for NodeJS on WindowsNov 7, 2013
README.mdMinor typoNov 7, 2013
console.js
i8080.jsInitial revision.Oct 4, 2012
i8080_disasm.jsInitial revision.Oct 4, 2012
i8080_test.jsInitial revision.Oct 4, 2012
i8080_trace.jsInitial revision.Oct 4, 2012
index.htmlInitial revision.Oct 4, 2012
main.jsInitial revision.Oct 4, 2012
rkdump.cInitial revision.Oct 4, 2012

README.md

Intel 8080 (KR580VM80A) microprocessor in JavaScript

This project is an implementation of the Intel 8080 microprocessor inJavaScript. This implementation passes successfully all tests for theKR580VM80 clone of Intel 8080 used in thei8080-core project.The emulator is independent from particular hardware. Memory and IOobjects are passed as parameters to the constructor.

This implementation doesn't use JavaScript Typed Arrays, and also opcodedecoding is implemented in a disassembler way.

It is tested on Chrome (Mac, Windows) and Safari (Mac, Windows).

Build (Mac)

make

This command will generate a test web page and launch the current web browser(on Mac). This web will run 3 tests: TEST.COM, CPUTEST.COM, 8080PRE.COM.

When you open the JavaScript console in the browser, you should see thefollowing:

Intel 8080/JS test*********************************File "TEST.COM" loaded, size 1793OUTPUT: MICROCOSM ASSOCIATES 8080/8085 CPU DIAGNOSTIC VERSION 1.0  (C) 1980OUTPUT: OUTPUT: CPU IS OPERATIONALJump to 0000 from 14f*********************************File "CPUTEST.COM" loaded, size 19200OUTPUT: OUTPUT: DIAGNOSTICS II V1.2 - CPU TESTOUTPUT: COPYRIGHT (C) 1981 - SUPERSOFT ASSOCIATESOUTPUT: ABCDEFGHIJKLMNOPQRSTUVWXYZOUTPUT: CPU IS 8080/8085OUTPUT: BEGIN TIMING TESTOUTPUT: END TIMING TESTOUTPUT: CPU TESTS OKOUTPUT: Jump to 0000 from 3b25*********************************File "8080PRE.COM" loaded, size 1024OUTPUT: 8080 Preliminary tests completeJump to 0000 from 32f

The main test 8080EX1.COM only runs when you use a standalone JavaScriptinterpreter (V8 or SpiderMonkey) because it may take longer than an hour.

make run-v8

or

make run-js

On Mac you can install V8 and JS (SpiderMonkey) viabrew:

brew install v8brew install spidermonkey

Benchmark

Time to run all 4 tests (TEST.COM, CPUTEST.COM, 8080PRE.COM, 8080EX1.COM) onMacBook Air 2GHz. The NodeJS test was performed on Windows 7 SP1 (i7 3.40GHz64-bit).

ImplementationLanguageJavaScript engineTime
i8080-coreANSI-C-0m58.793s
i8080-jsJavaScriptV8 3.9.2435m0.627s
i8080-jsJavaScriptSpiderMonkey 1.8.5166m43.369s
i8080-jsJavaScriptNodeJS 0.10.2118m48.38s

Using the emulator

An example of embedding the emulator can be found in the filei8080_test.js.You need to supply Memory and IO objects to the constructor of the I8080 class.