roerohan / 8086.js Goto Github PK
View Code? Open in Web Editor NEWA basic web-based 8086 emulator built with Javascript :rocket:
Home Page: https://roerohan.github.io/8086.js
License: MIT License
A basic web-based 8086 emulator built with Javascript :rocket:
Home Page: https://roerohan.github.io/8086.js
License: MIT License
Instead of using relative paths for importing files, use absolute imports.
Currently, if the bot runs into an error (that is thrown by the parser or the CPU), it is not caught and displayed on the frontend. The errors are just logged on the console in production.
The bot is deployed here, and as you would notice, it isn't very responsive, and doesn't scale too well according to screensize, especially on mobile phones. This might be a useful reference.
The scrollbars on the page do not go well with the dracula theme that has been used for the UI.
This one is about design. 8086.js
needs a logo and a favicon (could be the same).
public
directory.Please place both (or one if they're the same) the files in the public
directory and PR to the dev
branch ๐ฅบ
We're aiming to support interrupts on 8086.js
! The parser can currently recognize INT
as a mnemonic. The CPU is required to understand that the INT
mnemonic stands for an interrupt. Once this is done, features such as writing output to the display
in the UI, taking user input, and exiting the program, etc. can be implemented.
We would prefer a separate class for interrupts.
Currently, 8086.js
can only execute the instructions in the switch-case
below. However, support needs to be added for the remaining instructions to make it more usable.
Also, some instructions are not implemented properly, which maybe be because of one of the following reasons.
These need to be fixed to make it behave more like an Intel 8086.
The following is a list of instructions that have been implemented. They have been written in src/emulator/cpu/core.js, and they use the Addressing
class from addressing.js
in the same folder.
Note: Relative addressing has not been implemented yet.
8086.js/src/emulator/cpu/core.js
Lines 33 to 172 in 017505b
I get those errors and alerts that are shown in the image below when I try to install the libraries with npm install
I tried clearing the cache but it still did not install the libraries.
Everything worked fine when installed using yarn
, my recommendation is to use yarn
to manage project dependencies.
The bot can only execute instructions one by one currently. Features to execute all instructions at once, and step back an instruction to see the state would be useful for debugging!
stepClick
function below, which is triggered by clicking the next step
button on the UI.emulator.cpu.step()
repeatedly until the last instruction is reached.8086.js/src/components/ButtonsContainer/index.jsx
Lines 45 to 48 in 017505b
As of now, the parser is very simple and recognizes only Immediate, Register and Direct (Memory) addressing, as you can see in lexer.js. The goal is to support all types of addressing supported by Intel 8086.
The parser does not support pre-processor instructions such as assume
, or segments such as the data and the code segment. Support for this is essential for users to be able to create named procedures and store strings, etc. in the data segment.
Currently, the parser does not do a lot of syntax validation, in parser.js. This might allow instructions such as:
add bx, ; Notice the trailing comma
Stronger syntax checking needs to be implemented.
8086.js/src/emulator/parser/parser.js
Lines 44 to 60 in 017505b
The numbers on the UI are shown as hexadecimal numbers. A useful feature would be to have a dropdown somewhere on the UI to change the number system in which the registers are displayed. Possible alternatives to hexadecimal numbers would be
8086.js/src/components/Register/index.jsx
Line 49 in 017505b
In the Register
component, the values of the registers are displayed in hex
and are padded to 4 digits using the padStart
function. This works fine when the register is being displayed on the UI.
However, one of the features of 8086.js
is that you can edit the value in a register and execute instructions with the updated value. Now, because of the padStart
in the UI, updating a register becomes somewhat weird, since you can not delete a number (the padStart
function will always ensure that there are 4 characters). So, you would have to add a 5th number to be able to delete a number that is already present.
This can possibly be resolved by using the padStart
function when the user focuses out of the register
box. This might be related to #18 , since the padding would vary for hex
, binary
, octal
, and decimal
numbers.
8086.js/src/components/Register/index.jsx
Lines 49 to 62 in 017505b
Thanks to @DarkCode01 , we have a theme switcher implemented for the Editor (#40 ). However, it would be amazing to have a theme switcher for the entire page!
This is probably a good example of what we're looking for.
The goal is that when you switch from say the dracula
theme to the github
theme, the entire page should be colored like the github theme and not just the Editor
component.
This project has not been maintained for a while, so it's running older versions of a lot of libraries such as React.
These packages need to be updated, and the functionality needs to be tested after updating these packages.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.