Q.Mention the reason to write conputer instructions in assembly language?
[!TLDR]
We write instructions in assembly language for speed, smaller program size, special-purpose control, cost saving, and a better understanding of how the machine actually works.
Machine language is the binary coded language the CPU actually executes, but a long string of 1s and 0s is almost impossible for a person to read or write correctly. Assembly language bridges this gap: each machine instruction is given a short, meaningful mnemonic (such as MOV, ADD, SUBB), and once the program is written these mnemonics are translated into machine code by a process called assembling.
Because assembly deals directly with the internal structure of the CPU (its registers, memory and flags), it is called a low-level language, and this closeness to the hardware is exactly what makes it worthwhile for a microcontroller like the 8051.
The main reasons to write instructions in assembly language are:
- To speed computer operation — hand-written assembly can be tuned so the CPU does the job in the fewest possible steps.
- To reduce the size of the program — compact code occupies less of the limited on-chip ROM.
- To write programs for special situations — hardware-level tasks (timing, direct pin control) are handled precisely.
- To save money — smaller, faster code can run on cheaper, smaller memory.
- To better understand how the computer operates — you see exactly how each register and flag changes.
[!ANSWER]
Computer instructions are written in assembly language to speed up computer operation, to reduce the size of the program, to write programs for special situations, to save money, and to better understand how the computer operates.
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.