Structure of Assembly LanguageĪn assembly language program is a series of statements, which are either assembly language instructions such as ADD and MOV, or statements called directives.Īn instruction tells the CPU what to do, while a directive (also called pseudo-instructions) gives instruction to the assembler. For example, to write a program in C language, one must use a C compiler to translate the program into machine language. Similarly, a compiler translates a high-level language into machine code. In contrast, an assembler is used to translate an assembly language program into machine code (sometimes also called object code or opcode). To program in assembly language, a programmer must know all the registers of the CPU.ĭifferent programming languages such as C, C++, Java and various other languages are called high-level languages because they do not deal with the internal details of a CPU.
Assembly language is often termed as a low-level language because it directly works with the internal structure of the CPU. A program that is responsible for this conversion is known as assembler. Assembly language programs consist of mnemonics, thus they should be translated into machine code. Assembly languages were developed to provide mnemonics or symbols for the machine level code instructions.