8085 Simulator IDE Getting Started: Example 1 Example 2 Example 3 Example 4 Example 5 Example 6
8085 Simulator IDE Getting Started: Example 1 Example 2 Example 3 Example 4 Example 5 Example 6
Getting Started
There are six examples bundled with 8085 Simulator IDE. They are located in application folder.
This is short step by step guide for the beginners that will help them to test these examples and in
that way explore the most important features of 8085 Simulator IDE.
Example 1
Example 2
Example 3
Example 4
Example 5
Example 6
EXAMPLE 1
- Examine memfill.asm file from the application folder. This assembler routine fills the memory range
FF00H - FFFFH with values FFH - 00H respectively.
- Screenshot: view
EXAMPLE 2
- Examine memfill2.asm file from the application folder. This is modified example 1. The value that
will be used to fill the memory range FF00H - FFFFH is get from I/O port 01H. The routine is then
repeated.
L2: IN 01H ;get value on port 01H to be used for memory fill
MVI D,0FFH ;initial value in counter register D
LXI B,0FF00H ;initial value in pointer register pair BC
L1: STAX B ;load value in A to the memory location addressed by BC
INX B ;increment pointer BC
DCR D ;decrement counter D
JNZ L1 ;loop until value in D is zero
STAX B ;fill the last memory location FFFFH
JMP L2 ;repeat routine
.END
- Screenshot: view
EXAMPLE 3
- Examine bin2bcd.asm file from the application folder. This example is a binary to BCD conversion
routine.
BINBCD:
MVI B,100 ;load 100 into register B (power of ten holding
register)
CALL BCD ;call conversion for BCD3
MVI B,10 ;load 10 into register B
CALL BCD ;call conversion for BCD2
MOV M,A ;store BCD1
RET
BCD:
MVI M,0FFH ;load buffer with -1
STORE: INR M ;clear buffer first and increment for each subtraction
SUB B ;subtract power of ten from binary number
JNC STORE ;if number is larger than power of ten, go back and add
1 to buffer
ADD B ;if no, add power of ten to get back remainder
INX H ;go to next buffer location
RET
.ORG 0100H
BINBYT .DB 234 ;example binary number to be converted into a BCD number
OUTBUF ;output-buffer memory location
- Screenshot: view
EXAMPLE 4
- Examine interrupt.asm file from the application folder. This example shows how peripheral devices
and interrupts interfaces are used. The routine first sends five data bytes to port 02H (should be
treated as the initialization of the peripheral device) and then responds to generated interrupts by
echoing the value received on port 01H to port 02H.
- Screenshot: view
EXAMPLE 5
- Examine basmul.bas file from the application folder. This is Basic source program that will be
compiled using integrated Basic compiler. It is an integer multiply routine that will multiply two
integer numbers 123 and 234.
Dim a As Integer
Dim b As Integer
Dim c As Integer
- Click on Tools\Compile. The compiler will generate basmul.asm file with assembler source.
- Close BASIC Compiler window.
- Click on Tools\Assembler.
- Click on File\Open.
- Select basmul.asm file and click on Open. The assembler source program will be displayed in the
editor.
- Click on Tools\Assemble. After the operation is completed the assembler will generate two files:
basmul.lst (assembler listing with assembled opcodes) and basmul.obj (binary image of assembled
routine ready to be loaded into memory). The output listing file basmul.lst will be displayed.
- Click on Tools\Load. That will load the program file basmul.obj into 8085 Simulator IDE memory.
- Close assembler window.
- Check that Options\HLT Stops Simulation option is selected.
- Select the option Options\Refresh Breakpoints Manager.
- Click on Tools\Breakpoints Manager. That will open the Breakpoints Manager window.
- Reposition the windows on the screen to get better view, if necessary use Always On Top option
on Breakpoints Manager window.
- Click on the line corresponding to 003E address to define the breakpoint on this instruction. That is
the beginning of integer multiplication routine.
- Select the Hold PC In Focus option.
- Select the Rate\Fast simulation rate.
- Click on Simulation\Start. The simulation will start immediately.
- When the 8085 Simulator IDE reach the breakpoint it will automatically switch to Step By Step
simulation rate.
- Click on Rate\Fast to continue with simulation.
- Watch the program execution on the Breakpoints Manager.
- The simulation will stop when the HLT instruction is reached. The result of multiplication 28782
(706EH) will reside in HL register pair and also in memory locations assigned to variable 'c'.
- Screenshot: view
EXAMPLE 6
- Examine basprint.bas file from the application folder. This is Basic source program that will be
compiled using integrated Basic compiler. It is an integer multiply routine that will multiply two
integer numbers -123 and 234 and then send the formatted text showing the result of the operation
to the I/O port number 1.
Dim a As Integer
Dim b As Integer
Dim c As Integer
- Screenshot: view