Sunday, November 23, 2008

8085 Simulator for Windows (32 -bit)/ Linux

8085sim is a potential product for 8085 microprocessor instruction set simulation.The simulators for both Win(32-bit)/Linux are uploaded hereThe simulator for win is 8085sim.exe and for linux its named as 8085sim.
For Windows :
Copy the 8085sim.exe to any folder named 8085 or anything.It is necessary to copy this to a folder, otherwise the files created by the 8085sim.exe will get scattered around the environment folder.
Run the file
First we will be facing a main menu having 10 options.Select one of them using 1 to 10 numbers.

Code editor(2) & Memory editor (1)
Image above shows the main menu.number 2 is enetered for the code editor we type in the hex code (no need to put H at the end to indicate hex) of the instructions and will at last put a 76H(HLT)instruction.HLT is a must for a program entered in 8085sim.Without an HLT (76H)8085sim will execute infinite loops , so is the case for real hardware.
When we get into the code editor the
Codeeditor>>$ ORIGIN :
comes we have to type in the origin or starting address for the hexcode entry.
After the entry it prints the mapoffset and pc content
For the mem editor the pc will be different than the map offset.
Memory editor provides an interface to direct editing of memory. In this case we can store an array of numbers in some address and use that address in program.

Single step(3) & Normal exe(4)
Image above shows the single stepping mode for 8085sim.After the hexcode entry by using the code editor we can use singlestepping(3) or normal exe(4), for executing the program. When an instruction is executed the 8085sim diaplays all the reg contents below that after showing the instruction and address to which it has been entered.A single stepping or normal exe operation of 8085sim terminated with the execution of a 76 instruction.

Saving the program in harddisk(7)
The above image shows how to save a program that has been entered and executed to harddisk.The 8085 sim sets aside a memory map in RAM of the system ,for virtual 8085simulation.The memory map starts form 0000H to ffffH in hex.So it sets aside 64Kb of memory in RAM . After we leave the simulator it frees the RAM.When its been rerun it will initialise all the contents of RAM to 0H. So we need to write the entered hex code or memory content to hard disk. The purpose of save is to achieve this.We have to enter a file name and also the starting location of the code in memorymap.The saved file is created inside the folder to which the 8085sim was copied.When the file is saved successfully the 8085sim indicates it by printing the number of 8bit codes written to disk
----8-----File written to secondary storage device.
Now we can exit the 8085sim by typing 5.




Loading(8) & Dumping the RAM(9)
The image above shows how to load the file named 16bitadd.Suppose we are exiting the 8085sim by saving the current program.At anytime later on we can try executing the same program by loading that program file into the memorymap of 8085sim.Here the saved file is 16bitadd.
After succussfully loading the file the 8085sim prints a result as shown below.
-----8-----File successfully loaded.
where 8 is the number of code bytes in file.
8085sim also has a memory map analysis file called MAP.RAM. To print the contents of memorymap of 8085sim (0000h to ffffh) select the number 9 from the mainmenu.It dumps the contents of RAM to a file named MAP.RAM.
Assembler is under construction.

For LINUX:
I have tried the binary for Fedora Core 9.If there is any problem please comment.
For linux we have to copy the binary to the bin folder of root.
First open a terminal .Login as a root user
fedora home]$ su
password:
fedora home]#
After the entry as a root the command prompt change from $ to #
copu the 8085sim to /bin
type
home]# cp 8085sim /bin/8085sim
home]#exit
then the 8085sim binary will have entered into the /bin
Now one can type the 8085sim command anywhere to run the simulator.One problem with running the simulator anywhere is that u may not be having enough permissions to create files in some folders.In such cases the save file will show error message .So always use a valid path .Preferably create a folder for 8085simulator.I have created a folder named 8085simfiles in my home directory.
Now change the working directory to home ]$ cd /home/8085simfiles
Now run home]$8085sim
We can see the 8085 mainmenu as shown below



Code editor & Memory editor
Image above shows the main menu.number 2 is enetered for the code editor we type in the hex code (no need to put H at the end to indicate hex) of the instructions and will at last put a 76H(HLT)instruction.HLT is a must for a program entered in 8085sim.Without an HLT (76H)8085sim will execute infinite loops , so is the case for real hardware.
When we get into the code editor the
Codeeditor>>$ ORIGIN :
comes we have to type in the origin or starting address for the hexcode entry. After the entry it prints the mapoffset and pc content.For the mem editor the pc will be different than the map offset. Memory editor provides an interface to direct editing of memory. In this case we can store an array of numbers in some address and use that address in program.


Single step(3) & Normal exe(4)
Image above shows the single stepping mode for 8085sim.After the hexcode entry by using the code editor we can use singlestepping(3) or normal exe(4), for executing the program.When an instruction is executed the 8085sim diaplays all the reg contents below that after showing the instruction and address to which it has been entered.A single stepping or normal exe operation of 8085sim terminated with the execution of a 76 instruction.

Saving the program in harddisk(7)
The above image shows how to save a program that has been entered and executed to harddisk.The 8085 sim sets aside a memory map in RAM of the system ,for virtual 8085simulation.The memory map starts form 0000H to ffffH in hex.So it sets aside 64Kb of memory in RAM. After we leave the simulator it frees the RAM.When its been rerun it will initialise all the contents of RAM to 0H. So we need to write the entered hex code or memory content to hard disk. The purpose of save is to achieve this.We have to enter a file name and also the starting location of the code in memorymap.The saved file is created inside the folder to which the 8085sim was copied.When the file is saved successfully the 8085sim indicates it by printing the number of 8bit codes written to disk
----8-----File written to secondary storage device.
Now we can exit the 8085sim by typing 5.
Loading(8) & Dumping the RAM(9)
The image above shows how to load the file named 16bitadd.Suppose we are exiting the 8085sim by saving the current program.At anytime later on we can try executing the same program by loading that program file into the memorymap of 8085sim.Here the saved file is 16bitadd. After succussfully loading the file the 8085sim prints a result as shown below.
-----8-----File successfully loaded.
where 8 is the number of code bytes in file.


8085sim also has a memory map analysis file called MAP.RAM. To print the contents of memorymap of 8085sim (0000h to ffffh) select the number 9 from the mainmenu.It dumps the contents of RAM to a file named MAP.RAM.Assembler is under construction.

No comments: