How to feed Disassembly code of the instructions in the source file in LPCXpressso IDE?

Showing results for 
Search instead for 
Did you mean: 

How to feed Disassembly code of the instructions in the source file in LPCXpressso IDE?

Contributor III

Hello to all,

I would like to feed the dissembled code of the instructions in the source file.

I can see the disassembly (.dis) file by adopting an option "binary utilities -> dissamble" (this one was useful to see the disassembly code of written instructions in the in the source file.  


Instruction (in the source file)       Disassembled code


ADD R6,R5,#0x00000040         : f105 0640

NOP                                           : bf00

ADD R6,R5,#0x00000100         : f505 7680

ADD R6,R5,#0x00000A00        : f505 6610


But what, I want to do is just exactly the opposite of it. I want to feed the disassembled code in the source file and generate the corresponding Instructions, for eg. (f105 0640  should show me ADD R6, R5, #0x00000040).

Is it possible to perform such action in the LPCXpresso IDE???

Since, I am very much new to this area, ur input will be really helpful.

Thanks in advance,


0 Kudos
2 Replies

Senior Contributor III

Not sure why you would want to do this (please explain), but you can.

You can use a variety of directives:

.byte 0x10, 0x20, 0x30, 0x40
.hword 0x1234, 0xffff
.word 0x12345678

to insert 8-bit, 16-bit, or 32-bit data into your assembly files. You will also need other directives to place the data into appropriate sections (i.e. .code and .data), provide symbol names etc. You can find these in any good GNU Assembler tutorial

Contributor III

Hello Con Verse,

Since we all know all these instructions goes as binary in the board and upon these, all the operation occurs. Currently, I am working on a project, where I want to see the effect of hamming weight and hamming distance over the energy consumption. And need to compute the factor for both. 

And for that, what I was thinking is to give the 32-bit binary or the 8-byte hex code to the compiler. And this will be feed into the board and the corresponding energy effect will be noted down. Because in that case it will be easier to change a small value in that and we can see the variation in the hamming weight as well as in hamming distance. 

Right now, I was looking at the disassembly code of the instruction and computing the number of 1s and effect of it over the energy, but if I know how to put the disassembly directly into the board, my work will be easier. And the reason behind finding out the instruction is just simply to know which instruction has how many ones as an opcode.

Hopefully, I was able to clear my motive behind it. So, it will be great if u can guide me or provide me some tutorial link. Since, I have searched online, but couldn't get the much information. 

Since I am new to this, your input will be so much valuable to me.

Thanks a lot.

0 Kudos