Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] DSPIC33fj_Understanding disassembly Hex to assembly.

Status
Not open for further replies.

IANZACH

Newbie level 6
Joined
Mar 25, 2011
Messages
14
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,283
Activity points
1,367
Could someone possibly help me understand how to disassemble hex code to assembly for a dspic33fj.

from what I understand the hex code is intel inhx32 format.

so i took a snippet of hex code and tried to decode it via a excel spreadsheet.

here's where i cannot get to the same code as mikro C dissasembly.

According to inhx32 The basic format of the HEX file is:
:BBAAAATTHHHH...HHHHCC.

where: BB is a two digit hex byte count reperesenting the number of data bytes appearing on the line. (I understand this )
AAAA is the hexadecimal address this has to be divided by two ( this i compute and is the same as Mikro C).

TT: is the record type ( this I also get the same as Mikro C)

HHHH... . HHHH: . HHHH . is a four-digit hexadecimal data word. The
format is low byte, followed by high byte. There
will be BB/2 data words following TT. this is where I come unstuck.

let say we have the following:

:100714000F832000F07F240020A0B70010002000E9

this would then equate to :

10 Bytes appearing on the line

Address line :0714 divded by 2 = 38A for pic

I now have 20 83 0F this is the same as mikro C

from what I gather I now have to change the hex (20) into Bin this gives me b=" 10000".
if I now reference table 7.1 of the DSPIC reference manual it refers to the Instruction MOV
this is also confirmed by Mikro C disassembly.

from here on I cant seem to work out the rest .we have 83 0F left.

according to Mikro C

MOV #2096, W15

according to Mikro C W15 register is hex 1E .
yet I cannot find this info anywhere and more over I cannot seem to calculate where Mikro c gets 2096 and W15 out of 83 0F

Can someone point me in the right direction.
 

Why don't you import the hex code in MPLAB and display it in code memory disassembly view?
 

I am trying to understand how the assembler works
 

So I have worked on it some more and found that by multiplying OF x 2 we get 1E which happens to be where register W15 sits.

Still trying to figure out where the #2096 comes from.
 

Ok I have worked out the way it works

Thanks guys for all the help
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top