A web based graphical user interface which simulates 8088 microprocessors working.
https://ahmedhsn710.github.io/8086-microprocessor/
We have designed an 8086 micro-processor model using JavaScript to code the whole model. To create the front-end and visuals of our design, HTML and CSS are used. A text editor API is used through which users will enter their instructions and the instructions are compiled and run line-by-line through the buttons provided. Furthermore, for simplicity, only 8 registers and 16 memory locations have been added that are shown on the front-end to the user. The front-end also displays the machine code, current instruction running, and block diagram of the instruction cycles the instruction is passing through. Five instruction cycles have been added that include, BIU, Decode, ALU, Memory and Control Unit. To help the users better understand which instruction cycles are used in each instruction, we have added animations to the block diagram. Whenever an instruction passes through one of the five cycles, the block of the particular cycle is highlighted by color and the instruction is also displayed within that block with a certain delay between each cycle. This wraps up the design features of the front-end that we designed to showcase our model of 8086. Moreover, we have added the feature to only allow 8-bit value in an 8-bit register and 16-bit value in 16-bit register i.e. bit compatibility feature.
Moving on from the details of our model and onto the technicalities. Our design includes a very strict syntax as we didn’t include many error checks in the syntax. Therefore, the user has to follow certain rules when giving instructions in the text box that appears on the web page. Some of the rules are given below:
• After typing a comma “,” the user has to give a space before writing anything else.
• Double spaces are not allowed.
• Only single line comments can be written using ‘’;’’.
• Memory address should be in decimal.
• When introducing a label, the label takes up the whole line. No other instructions can be written in-front of it.
Our 8086 model includes 15 instructions that the user can provide and get an accurate output. The instruction include:
Our mov instructions takes all possible cases into consideration and allows the user to perform the instruction on any of the following cases:
• REG --> REG
• IMMEDIETE --> REG
• IMMEDIETE --> MEM (direct)
• IMMEDIETE --> MEM (register indirect)
• REG --> MEM (direct)
• REG --> MEM (Register indirect)
• MEM (direct) --> REG
• MEM (register) --> REG
Inc instruction allows a value to be incremented.
Dec instruction allows a value to be decremented.
Neg instruction allows the user to get 1’s compliment of a number.
Not instruction allows the user to get 2’s compliment of a number.
And instruction allows the user to take AND of two values and store the result in the first operand. The following cases have been included in the instruction:
• REG --> REG
• IMMEDIETE --> REG
• IMMEDIETE --> MEM (direct)
• IMMEDIETE --> MEM (register indirect)
• REG --> MEM (direct)
• REG --> MEM (Register indirect)
• MEM (direct) --> REG
• MEM (register) --> REG
Or instruction allows the user to take OR of two values and store the result in the first operand. The following cases have been included in the instruction:
• REG --> REG
• IMMEDIETE --> REG
• IMMEDIETE --> MEM (direct)
• IMMEDIETE --> MEM (register indirect)
• REG --> MEM (direct)
• REG --> MEM (Register indirect)
• MEM (direct) --> REG
• MEM (register) --> REG
Xor instruction allows the user to take XOR of two values and store the result in the first operand. The following cases have been included in the instruction:
• REG --> REG
• IMMEDIETE --> REG
• IMMEDIETE --> MEM (direct)
• IMMEDIETE --> MEM (register indirect)
• REG --> MEM (direct)
• REG --> MEM (Register indirect)
• MEM (direct) --> REG
• MEM (register) --> REG
Add instruction allows the user to ADD two values and store the result in the first operand. The following cases have been included in the instruction:
• REG --> REG
• IMMEDIETE --> REG
• IMMEDIETE --> MEM (direct)
• IMMEDIETE --> MEM (register indirect)
• REG --> MEM (direct)
• REG --> MEM (Register indirect)
• MEM (direct) --> REG
• MEM (register) --> REG
Sub instruction allows the user to SUBTRACT two values and store the result in the first operand. The following cases have been included in the instruction:
• REG --> REG
• IMMEDIETE --> REG
• IMMEDIETE --> MEM (direct)
• IMMEDIETE --> MEM (register indirect)
• REG --> MEM (direct)
• REG --> MEM (Register indirect)
• MEM (direct) --> REG
• MEM (register) --> REG
Jmp instruction allows the user to JUMP to a label.
JE instruction allows a user to JUMP to a label when zero flag is 1, which means that the two values are equal.
JE instruction allows a user to JUMP to a label when zero flag is 1.
JE instruction allows a user to JUMP to a label when zero flag is 0, which means that the two values are not equal.
Cmp instruction allows the user to COMPARE two values.
Xchg instruction allows the user to EXCHANGE values between two operands.
Nop instruction basically means no operation is being done.