How to convert c to asm

I understand that C Language was created to allow the non Engineers to write application programs using English-like statements without knowing the detailed hardware architecture of the processor.

Noted with gratitude.

If you are just wanting to copy/paste your way into a degree or a job with microcontrollers, follow post #16.

I usually use AVR Studio 4 for ATmega32A and MicroChip Studio for ATmega328P, get the hex file and fuse it into the target MCU using a Commercial ROM Programmer or a self-made ISP Programmer.

That would be FORTRAN.
C was created to ease the porting of operating systems

1 Like

If you want to see the assembler code which was generated for an AVR target from C/C++, look up avr-objdump -S. You run this against the .elf file. There are a number of example posts: How can one view the assembly code output from the Arduino IDE?

C is like "high-level assembly code". It just hides the machine code (the instruction set, the output of assembly code, it avoids to write assembly code).
But it is not related to an OS, to a platform etc.: you have to do all your low-level HW init still in C-code: the language does not have any clue on which OS or platform it will run. The the platform LIBs do the job.

C (and C++) is cool because you can still do all the "dirty tricks" as you can do in assembly code,
e.g. to place a pointer into a memory and read from there, or access registers in MCU (used to initialize the system).
C (C++) does not have any limitations what you should not do (e.g. to access a protected memory space).
It is just a higher abstraction for assembly code, w/o any clue of your system you are running on (except: the processor architecture is important for compile, which code to generate).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.