Jump to content
Sign in to follow this  
Andrew0820

PIC HEX Files

Recommended Posts

I'm trying to decipher the hex files produced by the assembler and provided by many programmers.

Any comments, help or links will be most appreciated. Here is what I have so far.

Byte 1: Number of bytes of op code included in the line

Bytes 2 & 3: Address counter in raw bytes of op code.

Byte 4: ??? -- zero in the files I've seen

Bytes 5 - 20: op codes stored as 2 byte fields in Little Endian format. Clipping the high order nibble will yield a 12 bit code.

What is byte 21 in each line?

Thanks,

andrew

Share this post


Link to post
Share on other sites

Maybe you could download IC-Prog ( http://www.ic-prog.com ). It can open a HEX file and disassemble it. Then you can look at a PIC's datasheet to find the correspondence between instructions and their translations in binary machine code. Maybe that could help you finding your way through the bytes ;)

Share this post


Link to post
Share on other sites

Thanks for the reply. I've already disassembled several HEX files and have determined the OP Code locations -- 2 byte Little Endian with a high order ZERO nibble. The two bytes in the HEX record structure that are not clear are byte 4 and the last byte in each record.

The last byte does not seem to have any particular pattern, unless it is either a parity byte or CRC check. I can do bit counts for parity, but there are several CRC algorithms --

Regards,

andrew

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...