Computer Science, asked by Gopalkrishna4961, 1 year ago

what are the advantage of assembly language over high level languages?

Answers

Answered by kumarmaish889ox8fsq
1

Assembly Language allows you to carefully control the individual instructions the processor executes. As noted in answers, this fine-grain control can allow the following benefits:

Use special processor instructions such as SIMD, memory controller manipulation, processor identificationAccess to special processor features such as supervisor instructions and hardware timersUse cache instructions, port I/O, memory mapped peripherals, and DMA registersCan handle interrupts and low (even zero) memory situations and context switches with high predictabilityPerformance - one can directly optimize instructions, memory, and coherency for maximum computational and memory efficiency

Challenges are many too:

Assembly language is specific to a processor. Even within a family (such as 80x86) there are vast differences between the instructions available for a 8086, 80386, and 80x86 that supports 64-bit instructions and that is before dealing with special instructions noted above such as SIMD. This means your available instructions (and there for the “language” you are programming in) is dependent on the actual processor you are running on!Very painstaking — even operations such as multiplying two numbers together requires the overhead of “getting” the number and deciding where to put the result… (which register? on the stack? write back to memory?)Interfacing to other languages can be complicated — you have push / pop your own variables and you have to pack the data in the form that language or library expects.Few built-ins in the language - a lot of “lifting” is required by the programmer including memory management and memory-object layout

In nutshell Assembly gives you control to do some things that high level languages cannot but due to the level of expressiveness requires many more lines of code. I would say assembly languages are “Computer-time efficient” and high level languages are “Human-time efficient”. Sometimes this is important such as when writing multimedia codecs but other times human time is much more important (bringing up applications quickly!).

High level languages are generally very human-time efficient. You can write applications quickly, and tasks such as creating objects and managing memory are often handled for the programmer, allowing one to concentrate on application level issues such as user experience or insuring that data is consistent even if a problem has occurred. For example one can write a basic web application using a basic framework plus HTML/JavaScript/ and a good back-end (whether PHP or MEAN etc) using hundreds of lines of code. The equivalent in assembly could be literally millions of lines of instructions.

Also high level languages such as Python and JavaScript allow run-time changes to the code without compilation (think about how JavaScript is interpreted in your browser). This allows the code to be piece-meal loaded as necessary and interpreted/changed dynamically.

High level languages are also much more portable and usually are easier to debug and write quality code in.

And of course, you can run the same exact code on different operating systems and processor architectures. So high level languages are human-time efficient and portable but at the expense of some possible optimizations and not being able to perform some low-level tasks.

Usually, with modern hardware, human-time and portability are the most important things to optimize.

Answered by Anonymous
2

ANSWER :

➻It is a machine independent language.

➻The error detection and correction is easier.

➻The instructions can be written in simple English words.

➻It is easier to understand and develop the program logic.

❤HOPE IT HELPS ✨✨

Similar questions