question archive Explain in detail the advantages and disadvantages of Machine language and Assembly language
Subject:Computer SciencePrice:9.82 Bought3
Explain in detail the advantages and disadvantages of Machine language and Assembly language. Elaborate explanation required.
Machine language is a primitive language. It's a link between computer science and electronics engineering. It's as easy as working a multiplexer and demultiplexer. Any combination of 0s and 1s is created by the instruction and used for a particular job / event.
In a simple example, suppose your house's electrical panel has three switches, one for a fan, one for a dim light, and one for a tube light. 0 represents the off state of the switch and vice versa. You can then make 2 ^ 3 = 8 possible states.
000 -> means every thing is off.
001 -> everything off except tubelite.
.
.
100-> everything off except fan.
.
.
.
.
111 -> everything is on.
like wise in computer processors every sequence of 1 & 0 enables or disables many switches to make the job done.
as these codes are directly understandable by circuit itself there is not over head delay of compiler or interpreter or OS.
Advantages:
Disadvantages:
Assembly language:
Assembly language is a low-level programming language. Helps you understand machine language programming languages. Your computer has an assembler that helps you convert assembly code into executable machine code. Assembly language is designed to be used in machine language to understand and further process instructions. Whether it is an operating system or a computer architecture depends primarily on the architecture of the system.
Assembly language consists primarily of mnemonic processor instructions or data and other instructions or instructions. It is created by compiling the source code of a high-level language such as C or C ++. Assembly language helps you fine-tune your program.
The assembly language helps programmers write human-readable code that is similar to machine language. Machine language is just a series of numbers and is difficult to understand and read. Assembly language helps you have complete control over the tasks your computer performs.
to print "Hello world" in Windows
global _main
extern _printf
section .text
_main:
push message
call _printf
add esp, 4
ret
message:
db 'Hello, World!', 10, 0
The advantages are:
You can run complex jobs more easily.
Memory efficiency is high because it uses less memory.
The execution time is short, so the speed is high.
This is primarily hardware oriented. Fewer instructions are needed to get results.
Used for important work. No need to track the location. It is a low-level embedded system.
Disadvantages The drawbacks are:
It takes a lot of time and effort to write code.
It's very complicated and difficult to understand.
It's hard to remember the syntax.
There is a lack of program portability between different computer architectures.
Running a long program written in assembly language requires more computer size or memory.
Step-by-step explanation
Machine Language | Assembly Language |
---|---|
Machine language is only understand by the computers only. | Assembly language is only understand by human beings not by the computer. |
In machine language data only represented with the help of binary format(0s and 1s), hexadecimal and octadecimal. | In assembly language data can be represented with the help of mnemonics such as Mov, Add, Sub, End etc. |
Machine language is very difficult to understand by the human beings. | Assembly language is easy to understand by the human being as compare to machine language. |
Modifications and error fixing cannot be done in machine language. | Modifications and error fixing can be done in assembly language. |
Machine language is very difficult to memorize so it is not possible to learn the machine language. | Easy to memorize the assembly language because some alphabets and mnemonics are used. |
Execution is fast in machine language because all data is already present in binary format. | Execution is slow as compared to machine language. |
There is no need of translator.The machine understandable form is the machine language. | Assembler is used as translator to convert mnemonics into machine understandable form. |
Machine language is hardware dependent. | Assembly language is the machine dependent and it is not portable. |