Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

an emulator for 16f877

Status
Not open for further replies.

serhankars

New Member
Hi everyone
I want to implement an emulator for a board which includes 16f877 as microcontroller and as a start point in design I want to emulate the program
by taking the hex file which I get by compiling an .asm file to .hex file.

Altough I found the stucture of .hex files' records on the web
I can not give any meaning to the numbers of the hex records.

What I mean is I can not understand which instructions are in the hex file's records.

Could you please help me in order to solve my problem?

Any documentation which tells about dissassembling an .hex to .asm will be appreciated.

Thanks
PS: I am looking for a quick answer :)
 
Download my software WinPicprog which has a built-in disassembler, if you actually want to dissasemble a file - if you want to WRITE a disassembler, then just read the datasheet for the 16F877A - all the instructions are listed there, and it's a reasonably easy job as they all are one word long.

You can download the old Windows 16 bit source for WinPicProg (including the disassembler) from Dontronics - presumably that's where ICProg got it from?.
 
Firstly I want to thank you, for your answer
But :)

I know the structure of 16f877's instruction set bit coding.
I also have both a sample .asm file and .hex file of it.

Then let me change my questions:

1)16f877 's instructions are 14 bit instructions
but I should read 2bytes each(16 bits-the data bytes-) for an instuctor
from the hex file.
(AM I RIGHT HERE?Are their bit encodings put to the hex file,
to the appropriate places,without any conversion,I guess it doesn't, but... )

So does the instruction stay in the hex file like:

xx(the fourteen bit instuction)

or like

(the fourteen bit instuction)xx ?

Which one is correct and does two bits' (xx's) value
change time to time, or is it always the same like 00?
 
The HEX file is explained in the appendix in the MPASM helpfile, that's where I got it from - it's a little bit complicated by the fact it's intended for 8 bits and not 14 or 16.
 
Status
Not open for further replies.

Latest threads

Back
Top