Basic Elements
Basics
• Assembly language statements are written one
per line.
• A machine code program consists of a
sequence of assembly language statements.
• Each line of an assembly language program is
split into four fields, as shown below
• LABEL OPCODE OPERAND COMMENTS
• The label field is optional.
• A label is an identifier (or text string symbol) to
identify the certain code.
• START: mov ax,bx
mov cx,mydata
jmp start
• The opcode field contains a mnemonic.
• Opcode stands for operation code, ie, a machine
code instruction.
• The opcode may also require additional
information (operands).
• This additional information is separated from the
opcode by using a space (or tab stop).
• The operand field consists of additional
information or data that the opcode requires.
• In certain types of addressing modes, the
operand is used to specify
– constants or labels
– immediate data
– data contained in another accumulator or register
– an address
• ; ( Semicolon) is used for comments.
ASSEMBLER DIRECTIVES
• Assembler directives are instructions to the
assembler, and are not translated into machine
instructions.
• The use of directives gives the programmer
some control over the operation of the
assembler.
• The following is a list of the common pseudo-
ops.
– EQUATE
The EQU directive creates absolute symbols and
aliases by assigning an expression or value to the
declared variable name. Its format is,
• name EQU expression
– NUMBER1 EQU 36H