Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 8085 Microprocessor simulator (in Python)
- Latest release: Version 2.0.1
- -----------------------------------------------------------------------------------
- Note:You need to have Python version 2.x to run these files, Python version 3.x might cause some problems.
- You may download Python from here: http://www.python.org/download/releases/2.7.3/
- -----------------------------------------------------------------------------------
- Note:It is recommended that you go with the latest version (2.0.1) unless you want to explore the coding of the other versions.
- -----------------------------------------------------------------------------------
- Contents:
- I. Downloading and placing files
- 1.Links
- a.Python Code
- b.'.py' files
- 2.Procedure
- a.Python Code
- b.'.py' files
- 3.File placement/heirarchy
- a.Version 1.0
- b.Version 1.1, 2.0, 2.0.1
- 4.Other resources
- II. Running the simulator program
- III.Operating the simulator
- -----------------------------------------------------------------------------------
- ===================================================================================
- I. Downloading and placing files
- 1.Links
- Information about how to use these links proceeds in section I.2 - "Procedure"
- a.Python Code:
- up8085.py : http://pastebin.com/fihb3GTY (version2.0.1)
- led.py : http://pastebin.com/H62rfhMt (for version2.0.1)
- up8085.py : http://pastebin.com/Ycy5uejR (version2.0)
- up8085.py : http://pastebin.com/FtBfKkgC (version1.1)
- up8085.py : http://pastebin.com/kurjfci0 (version1.0)(no longer functional)
- led.py : http://pastebin.com/s0hS6LU8 (common)
- b.Complete '.py' file-sets:(easier)
- Version 1.0 http://www.mediafire.com/?5f31055e0t6d2
- Version 2.0 http://www.mediafire.com/?867tceb6bbj03
- Version 2.0.1 http://www.mediafire.com/?u758pbvx6m3mi
- 2.Procedure
- a. Python Code
- If you decide to go with copy-pasting the Python code, here's what you have got to do:
- i. Decide the version you want to use and go to the respective links.
- The file 'led.py' is common for all versions except Version 2.0.1, for which you will save to use the file 'led.py' labeled as 'for version 2.0.1'
- ii. Before you copy the content from those links you have to create a folder by any name(say "8085") you want in any directory you want.
- iii.Then create a new folder by the name "bin" in the folder("8085") you just created, only if you are not going with version 1.0
- iv. Now go to the links and just press the little button with a yellow symbol marked on it to copy the text to clipboard or click the 'RAW' option above the text to go to a page containing just the content of the file and copy all the text here.
- v. Now open "Notepad" or any text-editor and paste all the copied text into the editor.Then save it in the folder("8085") with the name "up8085.py"
- vi. Repeat step(v) for the file "led.py" and save it in the same folder("8085") as you saved "up8085.py". You are almost done.
- vii.Now finally if you didn't decide to go with version 1.0, go to the link "opcode.txt" and repeat step(v) except this time in the editor save the file as "opcode.txt" in the folder("bin") which is inside the folder("8085").
- If you decided to go with version 1.0 you will need to copy the file "OpcodeSheet.pkl" and place it in the folder("8085").
- Head on to section II - Running the simulator program to start using the simulator.
- ix. You might want to install the font "Monaco.ttf" in your computer for
- aesthetic feel although this is completely optional.
- b. Complete '.py' file-sets
- i. Select the version you want and go to the respective link
- ii. Now download the files "up8085.py" and "led.py" and place them in the
- same directory(say "8085").
- iii.Then if you are going with a version other than version 1.0 you can
- download the entire "bin" folder into the folder("8085") or you can create a folder by the name "bin" inside the folder("8085") and just download the file "opcode.txt" into this folder("bin")
- iv. If in case you decide to go with version 1.0 you have to download the
- file "OpcodeSheet.pkl" and place it along with the other two downloaded files - ("up8085.py" and "led.py")
- Head on to section II - Running the simulator program to start using the simulator.
- ix. You might want to install the font "Monaco.ttf" in your computer for
- aesthetic feel although this is completely optional.
- 3.File placement/heirarchy
- After completing the above procedures your files should be placed as shown below, assuming the root directory to be "8085"
- a.Version 1.0
- /8085
- -up8085.py
- -led.py
- -OpcodeSheet.pkl
- b.Versions 1.1, 2.0, 2.0.1
- /8085
- -up8085.py
- -led.py
- /bin
- -opcode.txt (compulsory)
- -exp2b.dam (optional)
- -exp3.dam (optional)
- ... (optional)
- -sorting.dam (optional)
- 4.Other Resources
- To view a demonstration of version 1.0 of this simulator go to
- Other version demonstrations coming soon...
- For additional help you can email the creator at aditya95sriram@gmail.com
- -----------------------------------------------------------------------------------
- II.Running the simulator
- 1.In order to run the simulator just double-click the file "up8085.py".
- 2.If that doesn't work try one of the following:
- a.Right-click on the file "up8085.py" and in the context menu select "Open with..." and select "Choose Program".
- This will open a dialog box, in this dialog box click "Browse" and navigate to the folder/directory where
- you installed Python and search for the file "python.exe". Then select that application
- as the program you want to open ".py" files with and click "Open".
- You will have to carry out that procedure only once and not everytime you want to open
- the file.
- b.Make sure you named all the files correctly and placed them in the proper directory. Check out section I.3 to
- compare the file heirarchy.
- -----------------------------------------------------------------------------------
- III.Operating the simulator
- 1.For instructions and keyboard shortcuts/mappings press the F1 key(only in version 2.0.1)
- 2.If you get stuck at any point press the "RST" key to reset the Microprocessor. This will result in the LEDs
- displaying "FrIEnd" meaning 'everything normal'.This is the 'reset' state and also the default state. Keep in mind that this does not clear all the memory.
- 3.To set the content of any memory address
- a.Press "RST" button if not already in 'reset' state
- b.And then press the "SET" button, this will blank out the display, and the little dot beside the first four
- LEDs will light up(only in version 2.0.1) meaning the processor is ready to accept input in the address field.
- c.Now you may enter the address in the hexadecimal format using the number-pad buttons.
- d.On completion of address entry press the "INR" key to comfirm the address and move onto setting it's content.
- e.On pressing the "INR" key the little dot beside the last two LEDs will light up(only in version 2.0.1) meaning
- the processor is ready to accept input in the content field.
- f.Now again use the Number-pad buttons to input the desired content in hexadecimal format.
- g.To confirm the input and move on to the next memory location press the "INR" key again.
- h.Now repeat steps(e-g) till you have set the memory contents
- i.If in case you want to set the content of memory location not easily accessible from the current memory location, press "INR" to set the current memory location content, and then press "RST" and respeat steps (b-h)
- 4.To execute the program
- a.Press the "RST" button
- b.Then press button "8" below which is written "GO".
- c.This will blank out the memory just as it would for entering the memory address in Section III.3.b
- d.Now enter the starting address of your program, or the address from where the execution should begin.
- e.After that press "EXEC" button to start execution
- f.Now while executing the program the processor displays "E" meanign execution in progress. Once the execution
- is done it will display "FrIEnd" or the 'reset' state if no error was encountered. If in case there was an error
- it will display "FError".
- Possible cause of the error may be failure to enter any data where the input was supposed to be.
- Note: The processor only initializes the memory locations visited while carrying out the procedure descrivbed in Section III.3 to '00 H' other memory locations do not exist at all, hence it is imperative to set all teh required memory locations with some value, rather the n relying on the processor to pick on trash values.
- 5.To see the result of the program execution
- a.Memory locations
- After execution if not already in 'reset' mode, press "RST" key and then follow procedure described in
- Section III.3 to go to the memory location where the result is expected and see it's contents.
- b.Registers and flags
- i. To check the Flag status and the internal registers, it is recommended to execute the program once again
- using the method described in Section III.4.
- ii. Press "RST" if not in 'reset' state and then press the button "3" below which is written "REG".
- iii.This will blank out the display and wait for you to enter a register name to display it's content, any key
- on the Number-pad from 4-F will display the corresponding register written below it, except 'F' which will display the flag status.
- iv. Once a register is selected, other registers can be viewed by pressing the "INR" or "DCR" keys. Here
- pressing a key from the number pad will affect the register content.
- 6.To save and load files
- a.This simulator supports files of type ".dam" (Data Assisting Microprocessor) for loading and saving the memory
- states.
- a.Press the "A" button below which is written "LOAD" to load a file and the "B" button below which is written
- "SAVE" to save the current memory content with a desired name.
- -----------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement