1

I wonder what is the purpose of assembly language

To build a program computer changes high-level language to assembly language, and then changes assembly language to machine language.

HLL(high level language) -> AL(Assembly language) -> ML(machine language)

But why we use AL? Is it not possible to change HLL to ML directly?

user2622016
  • 6,060
  • 3
  • 32
  • 53
Jay Lee
  • 13
  • 2

1 Answers1

0

Some compilers actually generate machine code directly. Some use their own intermediate language (see for example LLVM Intermediate Represenation), and some generate assembly code.

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.
  • when it wants to show to a user (human readable) result of compilation
user2622016
  • 6,060
  • 3
  • 32
  • 53