Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 3rd August 2005, 04:55 PM   (permalink)
Default Converting C Code to Assembly Language

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
Electrix is offline  
Old 3rd August 2005, 05:00 PM   (permalink)
Default

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 is offline  
Old 3rd August 2005, 05:55 PM   (permalink)
Default

Quote:
Originally Posted by Exo
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 !
Electrix is offline  
Old 3rd August 2005, 06:04 PM   (permalink)
Default

All you need is a disassembler

google for "x86 disassembler" , lots of free programs out there.
Exo is offline  
Old 3rd August 2005, 06:16 PM   (permalink)
Default

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.
checkmate is offline  
Old 3rd August 2005, 07:05 PM   (permalink)
Default

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.
__________________
EEgeek.net
evandude is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 05:44 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

eXTReMe Tracker