Professional Documents
Culture Documents
Example:
MYLABEL : MOV AX,BX ; abrakadabra
Name Field
• Used for instruction labels, procedure names and variable names
• 1 to 31 characters long
• Can contain letters, digits and following special characters
•.
•?
•_
•@
•$
•%
• Period must be used at the beginning
Syntax
• Operand : There can be 1,2 or no operand at all. For two operands,
generally, they are
Destination, Source
• Comment : Anything after (;)
• One of the operands can be a data
MYCONSTANT EQU 5
• EQU is a pseudo-opcode
• Constant can be a string as well
MOV
MOV destination, source
Source Destination Operand
Operand General Segment Memory Constant
Register Register Location
General X
Register
Segment X X
Register
Memory X X
Location
Constant X X
INC AX ; ax++
DEC MYBYTE; mybyte - -
NEG
• Single operand instruction
• NEG destination
• Destination is either a register or a memory location.
• Updates all flags
CF=1 unless result is 0
OF=1 if word destination is 8000h or byte destination is 80h
Type Agreement of Operands
• The operands of preceding two operand instructions must be of the
same type
ORG 1000H
ORG $+1000H
Overflow, Shift , Rotate
Overflow
Decimal Range of Decimal Range of Decimal Range of Decimal Range of
Signed Numbers in a Unsigned Numbers in Signed Numbers in a Unsigned Numbers in
Word a Word Byte a Byte