Assembly Language Discussion
Assembly Language Discussion
Programming of 8085
Introduction
• A microprocessor executes instructions given by the user
• Instructions should be in a language known to the microprocessor
• Microprocessor understands the language of 0’s and 1’s only
• This language is called Machine Language
Example: 01001111
– Is a valid machine language instruction of 8085
– It copies the contents of one of the internal registers of 8085 to another
Low-level/High-level languages
• Machine language and Assembly language are both Microprocessor specific (Machine dependent) so
they are called Low-level languages.
• Machine independent languages are called High-level languages.
Example:
BASIC, PASCAL,C++,C,JAVA, etc.
A software called Compiler is required to convert a high-level language program to machine code.
B. Arithmetic Operations
1. Addition of two 8-bit numbers
2. Subtraction of two 8-bit numbers
3. Increment/ Decrement a 8-bit number
Example:
D. Branching Operations
These operations are used to control the flow of program execution
1. Jumps
• Conditional jumps
• Unconditional jumps
2. Call & Return
• Conditional Call & Return
• Unconditional Call & Return
Example:
Register Addressing
• Operands are one of the internal registers of 8085
Examples:
MOV A, B
ADD C
Immediate Addressing
• Value of the operand is given in the instruction itself
Example
MVI A, 20H
LXI H, 2050H
ADI 30H
SUI 10H
Memory Addressing
• One of the operands is a memory location
• Depending on how address of memory location is specified, memory addressing is of two
types
a. Direct addressing
b. Indirect addressing
2. Two-byte Instructions
• First byte specifies Operation Code
• Second byte specifies Operand
Examples:
3. Three-byte Instructions
• First byte specifies Operation Code
• Second & Third byte specifies Operand
Examples: