Microprocessor Lab
Procedure for preparing programs to run on the Emulator
Making a program for the Emulator
- An editor that doesn’t add control characters, in other words, a generic text editor (MS-DOS Edit) must be used to write your source code. The editor is available at any DOS/ Windows based computers. Save your source code with an .asm extension under your working directory.
- Assemble your programs using Turbo Assembler. Location of Turbo Assembler is:
C:\Tasm
To assemble the program, give the following command:
tasm /l/r (filename).asm
- The program must then be linked into an executable format using Turbo Linker. Turbo
Linker is located in the same location as Turbo Assembler. For later purposes, you need to name the executable with .rom extension. To do so, give the following command:
Tlink (filename).obj, (filename).rom
- The next step is to create the configuration file for LOCATE, which will modify your program so that it will be mapped appropriately for your system. The following text must be put into a file with name, (filename).cfg.
hexfile intel86
absfile axe86
listfile segments
map 0xff000 to 0xfffff as rdonly //Memory mapping on SDK-86
map 0x00000 to 0x000ff as reserved
map 0x00100 to 0x007ff as rdwr
cputype i8086
class DATA = 0x40 //Data Segment value
class CODE = 0x00 //Code Segment value
output CODE
- The next step is to modify the program using the LOCATE program. LOCATE can be
found in the directory: C:\Locate
Give the following command to generate the modified program:
Locate –Hi (filename).rom
Remember, the name of the .rom file and .cfg file must be matched.
- After performing all of these steps, you should have files with the following extensions in your working directory:
.asm, .obj, .axe, .lst, .cfg, .hex, .map, .rom, .loc
Procedure for using HP 64700 Emulator
The following steps now have to be performed to set up the emulator:
- Start the HP Run-Time Debugger. Click on the “Emulator” icon on the desktop. If any error message shows, get help from the TA.
- Go to the command menu Settings Emulator Configuration Hardware and then check Enable internal 8087.
- The next step is to set up the memory map of the emulator to match the SDK-86. Go to the command menu Settings Emulator Configuration Memory Map. A new window should appear titled “Memory Map”. Enter 00100 in “Start” box and 007ff in the “End” box. Then click on “eram” and finally click “Apply”. You will see the mapping that you just added on the right. Do the same for the ROM mapping. Enter starting address at 0ff000 and ending address at 0fffff. Check on “erom” this time. Then click “Apply”. Once memory is set, click on “Close” to finish.
- Go to the command menu Break
- The next step is to load your program that you generated. Go to command menu FileLoad Object…then enter your filename with your working directory.
- Now you need to look at the source program in the “Source”. Click on the upper left corner of the “Source” window and then go to the command menu Search Address. Enter 0 and now see the program that you wrote. Verify with your .lst program for the binary codes.
- To run your program, go to the command menu ExecutionRun…Enter the address where the program begins.
- To run the program only up to a certain line of code, set the breakpoint. To do so, first set the cursor (by clicking on the line) on the line of the breakpoint. Then go to command menu BreakpointSet a Cursor. The BP sign will appear next to the line. Now “Run” as explained in step 7. Observe the conditions in the “Basic Registers” window and check the values of each register. To remove the breakpoint, go to the command menu BreakpointDelete at Cursor at the line of the cursor.
For any questions or problems, contact the TA.
(Rev. 11/2000)