Hello friends, today we are going to see the structure of assembly language programming. An assembly language often abbreviated asm is a low level programming language in which very strong cooperation between the instruction and the machine. It depends on the machine code instructions, and every assembler, the translator has its own symbolic machine code. It has six fields to write program: Memory Address, Machine Code, Opcode, Operands, and Comments. These are as follows.
Memory Address: These are 16-bit addresses of the user memory in the system, where the machine code of the program is stored. The beginning address shown as in the format “XX00”; the symbol XX represents the page number and 00 represents the line number.
Machine Code: Also called as instruction code. These are the hexadecimal numbers represents instructions that are stored in the respective memory addresses.
Label: A label is a symbol or group of symbols used to represent an address of specific statement. Labels are usually followed by a colon. Labels are not required in a statement; they are just inserted where they are needed.
Opcode (Operation Code): An instruction is divided into two parts: Opcode and Operand. Opcode are the abbreviated symbols to indicate the type of operation or function that will perform by the machine code.
Operand: The operand field of the statement contains the 8-bit or 16-bit data, the memory address, the port address, or the name of the registers on which the instruction is to be performed.
An instruction, called a mnemonic or mnemonic instruction is formed by combining Opcode and Operand. A mnemonic is just the letters which are usually initials or a shortened form of the English words for the operation performed by the instruction. For example, the mnemonic for subtract is SUB, the mnemonic for exclusive or is XOR, and the mnemonic for the instruction to copy data from one location to another is MOV.
Comments: This field is not become a part of the program, it simply a part of the proper documentation of a program to explain or remind of the function that this instruction or group of instructions performs in the program. These are separated by a semicolon (;) from the instruction on the same line.
The statement format and example are as follows.
Memory Address (Hex)
|
Machine Code (Hex)
|
Label
|
Opcode
|
Operand
|
Comments
|
2000
|
06
|
START:
|
MVI
|
B, 37H
|
; Load register B with data 37H
|
2001
|
37
|
|
|
|
|
2002
|
78
|
|
MOV
|
A, B
|
; Copy data from register B in to A
|
2003
|
D3
|
|
OUT
|
PORT 1
|
; Display accumulator (A) contents
|
2004
|
PORT 1
|
|
|
|
; (37H) at port1
|
2005
|
C3
|
|
JMP
|
START
|
; go back to the beginning and read the data 37 H again
|
2006
|
00
|
|
|
|
|
2007
|
20
|
|
|
|
|
For further information please see Microprocessors related topics:
Comments
Post a Comment
Your comment will inspire me, Please leave your comment