Search results
Aug 5, 2019 · A compiler does usually convert high-level code directly to machine language, but it can be built in a modular way so that one back-end emits machine code and the other assembly code (like GCC).
May 10, 2009 · Not all compilers do this - the MS compilers produce object code directly, though you can make them generate assembler output. Translating assembler to object code is a pretty simple process, at least compared with C→Assembly or C→Machine-code translation.
Why do compilers produce assembly code? tl;dr Assembly code is a step above machine language and it is human readable. A compiler compiles down to machine code, but may also need to produce or convert assembly code.
Compilers may generate code for a particular machine, not assuming any operating system or library routines. This is “pure code” because it includes nothing beyond the instruction set.
If a compiler for language X, however, generates assembly code instead of a linkable object file, it may be easier to use its output with the tool set associated with language Y.
May 25, 2020 · Both compilers produced target-specific assembly language code which they then assembled to produce linkable object modules. Most compilers are not capable of creating all the code required to produce a complete program from high level source only, so some assembly is required anyway.
People also ask
Does a compiler produce machine code?
Is assembler a compiler?
Does a compiler produce an assembly code?
Do assemblers generate machine code?
What do compilers produce?
What is a C compiler?
Dec 17, 2018 · Some of the reasons for compiler to use assembly is: when it does not have a machine code generator for target platform, and relies on already available assembler for this platform. Having (human readable) assembly output could also be helpful to the compiler designers.