EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / C code to assembly code

C code to assembly code

|

Microcontroller › 8051 › C code to assembly code

  • This topic has 21 replies, 12 voices, and was last updated 9 years, 10 months ago by aaliyan.
Viewing 15 posts - 1 through 15 (of 22 total)
1 2 →
  • Author
    Posts
  • March 9, 2011 at 8:01 am #4730
    dagakshay
    Participant

    hi every one many a times i got this kind of query that how to convert the C code to assembly code, the code given on this site is in C language i need the asm code, i dont know C, can you send me the asm code…. i prefer if you use C since it is common plateform, but when you go for core design were each and every cycle of the microcontroller does matter alot then you have to go for assembly code. and also it is a bit bitter/complex (atlest for me) to code using asm… but i personaly belive asm language is very versatile and a veery good way for efficent use of microcontroller… and one who had wrote the code in C must have a look at the asm code what is generated by the compiler itself so that i will make you habitual towards asm code….

    here i am writing few steps to see the asm code for the c code you have wote ( i have used keil complier here)…..

    step 1:
    save your file with “*****.C”  (dot c) extension…. (which you generally do)….

    step 2:
    after you have built you the file… go to start debug option… debug-> start/stop debug session


    step 3:
    now go veiw -> disassembly window 

    step 4:
    a new window will pop up, or click at he disassembly tab shown the the below pic marked in the red at the bottom….
    the first red block says 12: 13:……16: is the line of your c code and corresponding to that your C code is given in just next adjusant  block…
    the third red block below that is the asm code for your corresponding C code generated by compiler itself…

    same the 17th line code is marked in green and below it the asm code is given…

    if you have any further or any futher knowledge related to this topic share on this forum

    cheers
    -Dagakshay

    April 4, 2011 at 1:28 pm #5881
    romel emperado
    Participant

    hi.. is the generated asm is exactly the equivalent code of what you wrote in C?

    April 5, 2011 at 4:27 am #5890
    dagakshay
    Participant

    yup romel,

    that will be the exact equivallent asm code for the corresponding C code… but we can make a far better, effect or optimized equivallent asm code… since there is no option for optimization is given in KEIL as in AVR studio….. 

    April 5, 2011 at 4:35 am #5891
    romel emperado
    Participant

    thanks… got it.. :)

    April 14, 2011 at 6:01 pm #5976
    SaLMAN Ahmed Khan
    Participant

    MEANS AVR STUDIO CAN BEST TRANSLATE??? C TO ASM?

    April 15, 2011 at 5:16 am #5980
    dagakshay
    Participant

    actully not the bst but ya it can be a better option… just depends on comparsion

    April 18, 2011 at 11:12 pm #5996
    Chris S.
    Participant

    hey, where can i go to download the program Keil compiler to try this?

    April 20, 2011 at 12:46 pm #6009
    dagakshay
    Participant

    i have already posted some links her on this forum.. check my last post on this froum(below given is the forum link)

    http://www.engineersgarage.com/forums/8051/about-interface-adc0808-using-clock-8051-microcontroller-at89c51

    April 26, 2011 at 1:25 pm #6038
    dagakshay
    Participant

    hello anil i dint understand your point…

    May 3, 2011 at 12:05 am #6078
    Chris S.
    Participant

     can someone help me every time I try to use the program it only assemble the default sample code…..Help Please!!!

    May 6, 2011 at 9:40 am #6092
    dagakshay
    Participant

    @ shaun i dint get you what kind of help you want.

     

    @ Ronald. yes you are correct. that the same 

    August 21, 2011 at 4:24 pm #6618
    khalid
    Participant

    Thanks for the wonderful post Dagakshay,

    I tried it on uvision 4 and it gave me nothing but “NOPs”

    The code I used was copied straight from an Engineersgarage project.

    Any ideas why?

     

    tq

    January 25, 2012 at 2:03 pm #7075
    bobby
    Participant

    sir could u please tell me the frequency that is to be used in xtal column for this project  Automatic bidirectional visitor counter using 8051 microcontroller (AT89C51) posted on this site.http://www.engineersgarage.com/microcontroller/8051projects/Bidirectional-visitor-counter-AT89C51-circuit

    March 27, 2012 at 1:31 pm #7338
    meghana
    Participant

    Hey dagakshay i tried converting the code following the above steps of bidirectional visitor counter (http://www.engineersgarage.com/microcontroller/8051projects/Bidirectional-visitor-counter-AT89C51-circuit) from the given C code to asm in keiluvision

     

     

    But the only instruction i could see in the disassembly window was NOP.. 

     

     Can you please tell why? 

     

    or please send me the corresponding asm code of it.. 

     

    Thanx..

    August 5, 2012 at 2:24 pm #8399
    bhavesh
    Participant

    Please give me microcontroller program of automatic bidirectional visitor counter.

     

    i have it’s code from this site but i don’t know how to convert.

     

    so,pls convert this code into asm file send me on my mail account which is:-

     

    [email protected]

     

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 22 total)
1 2 →
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Panasonic RQ-A170 Walkman recorder November 7, 2025
  • strange laptop problem November 7, 2025
  • WTB: "The Theory Of Servicing AM, FM, And FM Receivers" by Clarence R. Green and Robert M. Bourque November 7, 2025
  • Converting 1vac to 24vac November 7, 2025
  • AC Input Relay Device Required November 7, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise