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.

Converting C Code to Assembly Language

Status
Not open for further replies.

Electrix

Member
Hello, I want to ask a question which has more it do with C ...I need to understand the Microprocessor assembly language..
I have written a C Code in T C++ 3.0 which is a basic RS232 Code for acceptind data. I need to convert this C Code back into Assembly Language, can i do that ??

How do I convert C to Assembly----

Thx
 
That's not a good way to learn assembler. A compiler adds lots of things to the assembly code that makes life simpler for the compiler itself but will get you confused in no time...

It's better to search a few good books about x86 assembler to start learning it.

Also, in case you didnt know, every family of processors uses its own instruction set / architecture. So if you plan on learning assembler to lear program microcontrollers (like pics) then you shouldnt be learning x86 (PC) assembler cause its totally diffirent.
 
Exo said:
That's not a good way to learn assembler. A compiler adds lots of things to the assembly code that makes life simpler for the compiler itself but will get you confused in no time...

It's better to search a few good books about x86 assembler to start learning it.

Also, in case you didnt know, every family of processors uses its own instruction set / architecture. So if you plan on learning assembler to lear program microcontrollers (like pics) then you shouldnt be learning x86 (PC) assembler cause its totally diffirent.

Hi Exo, I'm familiar with the x86 assembly, the reason i asked this question was because I want to see how a particlar program implemented in C, can be implemented in Assembly. I wanted to show this as a comparision ..of course C really shortens it out, but I want to see this assembly code anyway. I read it in Douglas Hall that we could do it in C as: C:\Tc\- S\Filename.c....I tried that but its not working.

So please tell me how I can do it !
 
All you need is a disassembler

google for "x86 disassembler" , lots of free programs out there.
 
As long as you use any of the built-in functions in C, your disassembled file is going to be hell. Or if you are just interested in learning how the compiler implements loops, constructs and function calls, I'd suggest you code in a uC compiler and use a corresponding disassembler. Some uC-based compilers even produce the asm file for you as an intermediate file.
 
check out the CC5x C compiler. It produces somewhat readable assembly code, with the C code as comments.

I currently use BoostC, however I admit the assembly it produces isn't as readable.
 
Status
Not open for further replies.

Latest threads

Back
Top