Git Product home page Git Product logo

8085_emulator's Introduction

Download this project as a .zip file Download this project as a tar.gz file

8085-Emulator by Vishal Sanserwal

Emulator for 8085 which supports 25 most commonly used commands which are -
Load and Store - MOV, MVI, LXI, LDA, STA, LHLD, SHLD, STAX, XCHG  
Arithmetic - ADD, ADI, SUB, INR, DCR, INX, DCX, DAD, SUI 
Logical - CMA, CMP
Branching - JMP, JC, JNC, JZ, JNZ
One Additional command SET has been made to set data into valid memory locations (Eg - SET 2500,0A )  

Debugger

The program also has a debugger mode which you can select at the start of the program.Currently, it has following abilities:

  • break or b [line Number]: it will set a breakpoint at the given line number.
  • run or r : Run the program until it ends or a breakpoint is encountered.
  • step or s : It will run the program one instruction at a time.
  • print or p [address or Register]: It prints the value of register or memory location for ex:
    p A will print the value of register A.
    p 2500 will print the value at memory location x2500 if any.
  • quit or q : quit the debugger
  • help: will show all the commands of debugger
The program will display contents of Registers A, B, C, D, E, H, L, flag Registers and used memory Locations only

How This Works

The emulator uses python-2 as a backend to perform all operations. Registers, as well as flags and memory, is taken as the ordered dictionary.
Note: Make sure to end the program with "HLT" as final instruction for both command line as well as file mode.

How to write program

Make sure all the statements are in CAPS.
For adding comments add '//' in start of instruction

Defining Label

LABEL: OPERATION OPERAND
GO: ADD B

Writing Program on Command Line (Command Line Mode)

The emulator has a mode to write the program on the terminal itself without providing the file as input. This mode can be selected the first time you start the emulator.
Note:To exit the writing mode enter "EOF"

Sample Program

//add 2 8 bit nos carry
LXI H,2500
MVI M,74
INX H
MVI M,AA
MVI C,00
LDA 2500
MOV B,A
LDA 2501
ADD B
JNC 2016
INR C
STA 2502
MOV A,C
STA 2503
HLT

To run program:

$ python emulator.py

8085_emulator's People

Contributors

vsanse avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.