Talking Electronics PIC Projects
 

Page1
Page2
Page3

DISASSEMBLING A PROGRAM
(Reading the .hex file of a PIC16F84)
Page 4

This section does not use the Multi-Chip Programmer but it is in this section as it is a part of the process of programming. If you take a .hex program from a book or magazine, or read a program from a chip, the block of digits is almost impossible to read. Sometimes it is important to know if the numbers refer to a particular program and you may wish to know if it is the latest version. You may also need to make a modification. 
The program in this article (the program is called Disasm) will take a .hex file from a
PIC16F84 and convert it back into a layout very similar to the set of instructions in an .asm file.  The only difference is the absence of annotations and labels.  
The program is called Disasm (for Dis-assembly program) and the files you need to get this program up-and-running, are contained in a self-extracting .exe file called 84Disasm.exe
The files are:
About.frm  3k    FRM File
Cmdialog.vbx  19k   VBX File
Disasm.exe    15k  Application File  This is the file you use (see below).
Disasm.frm     10k FRM File
Disasm.mak   1k MAK File
Disasm.txt     1k Text Document
To put these files on your computer, create a new Folder (go to Explore) and call it: Disassembler
To download the above 6 files in a 56k self-extracting .exe file, click HERE  

Disasm requires an Application Extension File: Vbrun300.dll You may already have it on your computer. If not, to download a 226k .zip file Vbrun300.zip click HERE

Unzip .exe & .zip  into the Disassembler folder.
Two files are needed in C:\Windows\System. Move Cmdialog.vbx and Vbrun300.dll into C:\Windows\System 
Installation is now complete.

USING DISASM
Disasm will disassemble your .hex files. Firstly you will need a .hex file. Create a new folder and call it: 5x7 Display Files.
To download all the .hex files for the 5x7 Display Project, click HERE
Unzip them into 5x7 Display Files folder. 
To make it easy, you can put them onto a disk and access them in drive A as 84 Disasm only sees the first 8 letters of each name and this is very difficult to follow!
You will need to unzip 84disasm.exe to get DISASM.EXE 
When you access Disasm on the "click HERE" below, you are accessing your own computer , so make sure the folder is in "C."

You are now ready to use Disasm.
To access Disasm, click HERE.
To run Disasm, double-click on the icon:


and a window will appear.
  Click on File.  Click on Open.   Double-click on the open folder: c:\    The folders on drive C will appear. Move down the list until 5x7dis~1 appears. Double-click on 5x7dis~1. The .hex files in this folder will appear in the window. Double-click on the file you want to disassemble. It will disassemble immediately. You can open two or more .hex windows (Disasm windows) at the same time to compare listings.
To save a disassembled file you MUST rename the extension to .asm, otherwise you will LOSE the original .hex listing.
To save a file, click on File. Click on Save as:  Click on the highlighted file in the address window to de-highlight it. Change the extension to .asm   Click ok. 
If you are working on a project, you must keep a back-up copy of your program on a floppy,  just in case something goes wrong. It is very difficult to re-build something that is lost, especially if it is a written piece of work.