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.

PIC .C code to .ASM

Status
Not open for further replies.

redlites

New Member
hey guys, i heard theres like a file converter from .C or .HEx to .asm? is that possbile? to anyone who knows, i need info on where to find it. thanks a lot! :)
 
redlites said:
hey guys, i heard theres like a file converter from .C or .HEx to .asm? is that possbile? to anyone who knows, i need info on where to find it. thanks a lot! :)

.C to .ASM is called a 'C compiler', you can buy various ones (but none are cheap), most have limited free versions.

.HEX to .ASM is a disassembler, my programming software WinPicProg has one built in - I understand MPLAB does it to some extent as well.
 
you can buy various ones (but none are cheap), most have limited free versions

a popular C compiler for the PICs is the PICC from HiTech software https://www.htsoft.com

there are four versions of PICC

the first one is PICC Standard that supports the 12/14/16/17 series PIC microcontrollers and sells for $950 https://www.htsoft.com/products/picccompiler.php

then there is the PICC-18 that supports the 18 series PIC microcontrollers and this one is also priced at $950 https://www.htsoft.com/products/pic18ccompiler.php

then there is the dsPICC which supports the dsPIC microcontrollers and this one is priced at $1150 https://www.htsoft.com/products/dspicccompiler.php

and then last but not the least there's the free C compiler from HiTech, the PICC-Lite. but there are no "free lunches" in this world. it only supports a limited number of PICs https://www.htsoft.com/products/PICClite.php

to look at the pricing of these compilers yourself go to https://www.htsoft.com/purchase/pricelist.php

there are a number of other C compilers for PICs like the CSS https://www.ccsinfo.com/picc.shtml. the CSS compilers has kool code generation wizards. there are other compilers for PICs like the C2C and the BoostC **broken link removed**

and for the disassembler i will suggest Nigel's WinPicProg. its a great programmer + disassembler.

i hope that helps
 
with MPLAB C Compiler u just need to open the C file and BUILD the code then tehre are 3 steps in all C compilers C Code -> ASM -> Binary Code (1's n 0's) so as they said any C compiler alows ( most of them ) to see the ASM code as it can also interpretate the ASM code inside a C file too with special Compiler flags, a DisAssember is required to disassemble any Binary code but you need a Disassembler that understainds the processor code in question or it wont interpretate well.
You can look at C Functions as an ASM macros because the ones that have libs are no more than that, ASM words have processor 1's and 0's codes binded, any language is no more than groups of binary functions, since the processor can only work with simple but fundamental functions such as ex. +-/* this is an example.
Assembler works like this ex. AddWF -> 00101001. (in uP1)
Assembler works like this ex. AddWF -> 01101010. (in uP2)
Usualy when they give the ASM Functions table it brings the correspondent Bin code too.
C functions are like this ex.
int SumOfTwo(int Val1, int Val2) ->
MovLW Val1
AddWF SumOfTwo
MovLW Val2
AddWF SumOfTwo

Something like that !!!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top