PDA

View Full Version : hex files don't agree



queenidog
- 30th June 2013, 20:29
I compiled a PicBasic Pro program using MicroCode Studio that compiled without error and the program works. When I look at the hex file created through the MELabs programmer under the tab "memory", the codes DO NOT match up with the hex file I open with Notepad.

Here's the first few lines of memory (whatever that is) in attachment memory.jpg7023
and the first few lines of the *.hex file called hex.jpg7024

How come?

Darrel Taylor
- 1st July 2013, 02:04
They look identical to me.

Maybe, knowing how the "Intel hex Format" works will help you see the same thing.
http://en.wikipedia.org/wiki/Intel_HEX

queenidog
- 2nd July 2013, 00:31
Since one of the files was in Notepad, I did a search for any pattern that looked like a command and came up empty. But you're right, it's my interpretation that is leading to the confusion, as I suspected. I'm quite familiar with Motorola S-records but not Intel.

In the Wiki you provided there is this statement: "Beware! While addresses are always given as big endian byte addresses, it's unspecified how to interpret the data bytes. Whether they are taken as bytes, 16- or 32 bit little- or big endian words is application specific."

So what is PBP? big or small endian? bytes? words?

-Can you break down and maybe highlight one or two commands that are "the same" so I can get my head around this? (I don't need to know this for any particular reason except that I MUST know it).

-What is the "memory" referred to in the MeLabs programmer popup? Is it program memory IN THE CHIP or is it some kind of buffer memory stored in PBP session, or is it a hex file located on the windows disk?

queenidog
- 2nd July 2013, 00:39
Ahh...I see it now. 28A2 in the first hex display (from PBP programmer) is shown as A228 in the second hex display (on hard drive).

The bytes are swapped.

Long time ago I decided to stick with Motorola assembler and machine code because their's was more intuitive than the backwards logic of Intel. (8080, 8086 stuff).