asmblah / jemul8

An object-oriented JavaScript x86 Emulator for Node.js and the browser
http://jemul8.com
Other
132 stars 19 forks source link

Define a clean public API #7

Open asmblah opened 11 years ago

asmblah commented 11 years ago

The public API should be derived via acceptance tests. For example, emulator.run() should return a Promise which should be resolved when the next HLT instruction is executed. Resuming the emulator (by calling .run() again) should return another Promise, and so on.

Work started in feature/acceptance (https://github.com/asmblah/jemul8/tree/feature/acceptance)

asmblah commented 11 years ago

feature/acceptance branch now contains a wrapper around the legacy API and a simple acceptance test which instantiates the emulator, writes some NOPs and a HLT to memory and executes them, using the new Promises-based API to detect when the HLT instruction is reached. This should allow smoother, faster BDD testing of the emulator's operation.