13 Mar 2013

What is a Assembly Language ?

The language we are communicate each other is a High label language and a Micro processor understand only low label language like 01. But we not understand or rather say difficult to communicate with a microprocessor with this language so we need a mediator means some language which we understand easily and also machine easily transfer it in their language so we need assembly language.
Assembly language was designed to do the same work as machine code but be much easier to use. It replaced all the ones and zeros with letters that were easier to remember but it is still a low-level language. The assembly equivalent of our machine code example 11000110 00010101 is the code 

ADD A,m.              This means ‘add any Number ,m to the value stored in the accumulator. 

We can see immediately that it would be far easier to guess the meaning of ADD A,m than 11000110 00010101 and so it makes programming much easier. If we had to choose letters to represent the ‘add’ command, ADD A,m was obviously a good choice. A big improvement over alternatives like XYZ k,g or ABC r,h. The code ADD A,m is called a mnemonic.A mnemonic (pronounced as nemonic) is just an aid to memory and is used for all assembly codes. 

Here are some example which are:

SLA E                                             for shift to the left, the contents of register E.
LD B                                               25H load the B register with the number 25H.


Now see how easy it makes it by guessing the meaning of these:


INC H
LD C 48H


Finally, have a go at one that we have not considered yet.


LD B B

SLA E                                          means shift the contents of register E one place to the left, then
SRA E                                             means shift the bits one place to the right. 

LD C 48H                                       means putthe number 48H into the C register. LD B B enables us
                                                        to  copy the number stored in the B register into the B register.

No comments:

Post a Comment