Assembly Language and Machine Language

In this course, we will study different programming languages used, assembly language, its advantages, its disadvantages, the instruction set of intel 8085, machine language, and the difference between the two.

What are the different programming languages used?

There are various programming languages that can be used for writing programs and applications. They are:
1. Machine language
2. Assembly language
3. High-level language

The CPU can only understand the language of ones and zeroes that is machine language. It is the first generation of programming languages. It was used in ancient times but it was hard to memorize and modify.

So the second generation of programming languages was developed, that is assembly language, the assembly language consists of English mnemonics. The assembly language was much easier to understand and memorize. Modification in the language can be done more easily. The assembly language is converted into machine language using a compiler.

Further, the third generation of programming languages was developed named the high-level language. It is completely English language and easy to understand and memorize. The high-level language is converted into assembly language with the help of an interpreter.

What is assembly language?

The assembly language acts as the intermediate language between the two-machine language and high-level programming languages. Assembly language is easier to comprehend and use as compared with the machine language; however, it is more complex than high-level programming languages.

☆ Assembly language is often called a low-level language as it is closer to the hardware level.
☆ Understanding of register structure and computer architecture should be there in programmers using assembly language codes.
☆ A specialized compiler known as an assembler is used for converting assembly language commands to object code or machine code.
☆ Assembly language statements comprise four sections. These are mnemonic, operand, label, and comment (the last two sections are optional).
☆ The mnemonics in assembly language gives us the instructions to execute commands; operands are parameters put in use for the command.
☆ Macros are also supported in the assembly language that is a set of commands with a name.

Assembly Language and Machine Language

What are the advantages of assembly programming language?

☆ Easy to understand and use
☆ Easy to locate and correct errors
☆ Easy to modify
☆ No worry to address
☆ Efficient that machine language

What are the disadvantages of assembly programming language?

☆ There is a requirement of knowledge of the processor architecture and instruction set.
☆ Machine language coding.
☆ Many instructions are required to achieve small tasks.
☆ Source program tend to be larger and difficult to follow.

What is the instruction set of Intel 8085 microprocessor according to assembly language programming?

ADD r - add
ADD M -add to the memory
ADC r -add with carry
Add M -add with carry to memory
LDI -load immediate
LDA -load accumulator direct
SLA -shift contents of the register one place to the left
MOV -move data
MOV M A -move result from memory to register A
STA -store on the register
STA a -store to the accumulator
JMP -jump
SUB r -subtract
SUB M -subtract memory
Cy -carry

What is the machine language?

The machine language comprises the bits. As we all know that for computers to understand the commands provided in high-level languages the instructions have to be converted in machine language that comprises bits. The compiler or interpreter does the conversion of a high-level language to machine language.

☆ Machine language includes zeros and ones. As we know that computers are in the form of digital electronic devices thus they use binary digits for performing their operations.
☆ One showcases the true or on state while zero depicts the false or off state in machine language.
☆ The method of converting high-level language programs to machine language codes depends on the CPU.

What are the advantages of machine language?

☆ The fast and efficient use of the computer can be done by using machine language.
☆ It requires no translator to translate the code. It is directly understood by the computer.

What are the disadvantages of machine language?

☆ All operation codes have to be remembered.
☆ All memory addresses have to be remembered.
☆ Finding errors in a program written in machine language is hard.

What is the variation between assembly language and machine language?

Assembly language Machine language
It is an intermediate programming language. It is a low-level language.
Assembly language uses English syntax and hence it is easier to understand. Machine language uses zeroes and ones and is not that much easier to understand.
This language is easily understandable by the programmers but not by the CPU. This language is harder to be understood by the programmer and can be easily understood by the CPU.
They are second-generation programming languages. They are first-generation programming languages.
The codes and instructions can be easily memorized by the user. The binary codes can’t be easily memorized.
Modification can be done very easily. Modification can not be done easily.
They are not platform dependent. They are platform-dependent and their features vary accordingly.
There is a need for a compiler for executing commands. There is no need for any sort of compiler for executing commands.