FORMAT OF ASSEMBLY LANGUAGE
Execution starts at the first
line of the program and continues sequentially except for ‘branch’ instructions, until the ‘end ‘ instruction is encountered. The result of each operation is
stored in a special word of memory called the “accumulator” (ACC).
Assembly language statements are written one per line. Each line of an assembly language program is split into four fields
namely:
a.
The
Label
b.
Mnemonics
c.
The
Operand
d.
The
Comment.
THE LABEL
Label is a name use to identify
an instruction. It is a name given to memory location where an instruction is
stored. Label is a character string beginning in the first column it is
optional, it can be placed at the beginning of a statement and it can be used
to refer to a memory location of the value of a piece of data of the address of
a program, sub-routines, code-portion etc.
Labels are used extensively in
programs to reduce reliance upon programmers remembering where data or code is
located. A label when declared is suffixed by a colon and begins with a valid
character (A-Z). E.g. FIRST: ADD al, 34Hex. The label is used in the
program as a reference.
MNEMONICS
Mnemonics is also referred to as Operation code. It is the portion
of an assembly language instruction that specifies the operation to be performed.
In assembly language, mnemonic form an Operation Code (opcode) is a command
such as MOV or ADD or JMP.
For example: MOV, AX, 34Hex where
MOV instruction is the opcode and the other parts are called the operands.
THE OPERAND
An operand is the part of an
assembly language instruction which specifies what data is to be manipulated or
operated on, while at the same time representing the data itself. Operand are manipulated by the opcode.
The operand filed consists of additional information or data that the opcode
requires.
THE COMMENT
When writing code, it is very
helpful to use some comments explaining what is going on. A comment is a
section of regular text that the assembler ignores when turning the assembly
code into the machine code. The assembly comments are usually denoted with a
semicolon. The comment field is optional and is used by the programmer to
explain how the coded program works. It is used to make your programs readable
and explain what you are doing in English.
0 Comments