unit 5 Assembly Language-1
unit 5 Assembly Language-1
Following is the table showing the list of Data-transfer instructions with their meanings.
Opcod
Operand Meaning Explanation
e
Rd, Sc Copy from the source This instruction copies the contents of the source r
MOV M, Sc (Sc) to the into the destination register without any alteration.
Dt, M destination(Dt) Example − MOV K, L
SHLD 16-bit address Store H and L registers The contents of register L are stored in the m
direct location specified by the 16-bit address in the operan
the contents of H register are stored into the next m
location by incrementing the operand.
This is a 3-byte instruction, the second byte specifi
low-order address and the third byte specifies the
order address.
Example − SHLD 3225K
Output the data from the The contents of the accumulator are copied into th
OUT 8-bit port address accumulator to a port port specified by the operand.
with 8bit address Example − OUT K9L
IN 8-bit port address Input data to The contents of the input port designated in the opera
accumulator from a port read and loaded into the accumulator.
with 8-bit address Example − IN5KL
Opcod
Operand Meaning Explanation
e
The 8-bit data and the Carry flag are added to the
Add the immediate to
contents of the accumulator and the result is stored
ACI 8-bit data the accumulator with
in the accumulator.
carry
Example − ACI 55K
Following is the table showing the list of Arithmetic instructions with their meanings.
1 Add) – The content of operand are added to the content of the accumulator and the result is
stored in accumulator .
with the addition instruction , the following 3 operations can be done.
1) any 8 bit number can be added to the contents of the accumulator and the result is stored in
the accumulator.
2) The contents of a register can be added to the contents of the accumulator and result is
stored in the accumulator .
3) The contents of a memory location can be added to the contents of the accumulator and
result is stored in accumulator.
this 1 byte instruction.
example – addb c it adds the content of accumulator to the content of the register b
2) SUB Any 8 bit data or the contents of a register or contents of a memory location can be
subtracted from the contents of the accumulator.
with the subtraction instruction the following 3 operator can be done .
1) any 8 bit number can be subtracted from the contents of the accumulator . The result is
stored in the accumulator.
In the table, R stands for register M stands for memory Mc stands for memory contents r.p.
stands for register pair
Applications:
Data processing: The arithmetic instructions in the 8085 microprocessor are used to perform
mathematical operations on data stored in memory or registers. This allows the
microprocessor to manipulate and process data in various ways, such as performing
calculations, generating checksums, and processing sensor data.
Control systems: The arithmetic instructions are used to perform complex calculations in
control systems. These calculations are used to make decisions based on sensor data and
other inputs, and to generate control signals that regulate the behavior of the system.
Signal processing: The arithmetic instructions in the 8085 microprocessor are used in digital
signal processing applications, such as audio and image processing. These instructions are
used to perform various operations on the digital signal data, such as filtering, compression,
and encryption.
Communication systems: The arithmetic instructions are used to perform various operations
in communication systems, such as signal modulation and demodulation, error correction,
and encryption/decryption.
Gaming: The arithmetic instructions are used to perform various operations in gaming
applications, such as calculating the trajectory of projectiles, simulating physics, and
rendering graphics.
Advantages:
Efficient arithmetic operations: The arithmetic instructions in the 8085 microprocessor can
perform a variety of arithmetic and logical operations quickly and efficiently, making it
suitable for applications that require fast arithmetic operations.
Reduced memory access: The use of registers and the accumulator in the 8085
microprocessor can help reduce the number of memory accesses required during arithmetic
operations, which can improve the overall performance of the system.
Supports a wide range of operations: The arithmetic instructions in the 8085
microprocessor support a wide range of operations, including addition, subtraction, logical
AND/OR/XOR, and shifting/rotating operations.
Simplifies programming: The arithmetic instructions in the 8085 microprocessor simplify
programming by providing a set of dedicated instructions for performing arithmetic and
logical operations.
Disadvantages:
Limited precision: The 8085 microprocessor uses 8-bit registers and arithmetic operations,
which limits the precision of calculations that can be performed. This can be a disadvantage
for applications that require high precision arithmetic.
Limited range of operations: Although the 8085 microprocessor supports a wide range of
arithmetic and logical operations, it does not support advanced operations such as
trigonometric functions or complex numbers.
Limited memory access: Although the use of registers can reduce the number of memory
accesses required, the limited number of registers in the 8085 microprocessor can restrict the
amount of data that can be manipulated at any given time.
Complex addressing modes: The addressing modes used in the arithmetic instructions can
be complex, which can make programming more difficult.
tions on data in registers and memory. Logical operations are operations that manipulate the
bits of data without affecting their numerical value. These operations include AND, OR,
XOR, and NOT.
The logical instructions in the 8085 microprocessor include:
1. ANA – Logical AND: This instruction performs a logical AND operation between the
accumulator and a specified register or memory location, and stores the result in the
accumulator. For example, the instruction “ANA B” performs a logical AND operation
between the contents of the accumulator and the contents of the B register.
2. ORA – Logical OR: This instruction performs a logical OR operation between the
accumulator and a specified register or memory location, and stores the result in the
accumulator. For example, the instruction “ORA C” performs a logical OR operation
between the contents of the accumulator and the contents of the C register.
3. XRA – Logical XOR: This instruction performs a logical XOR operation between the
accumulator and a specified register or memory location, and stores the result in the
accumulator. For example, the instruction “XRA M” performs a logical XOR operation
between the contents of the accumulator and the contents of the memory location
pointed to by the HL register.
4. CPL – Logical Complement: This instruction performs a logical complement operation
on the contents of the accumulator. This operation flips all the bits of the accumulator,
effectively reversing its value.
5. CMA – Complement Accumulator: This instruction performs a bitwise complement
operation on the contents of the accumulator. This operation flips all the bits of the
accumulator, effectively reversing its value.
Logical instructions are the instructions that perform basic logical operations such as AND,
OR, etc. In the 8085 microprocessor, the destination operand is always the accumulator.
Here logical operation works on a bitwise level.
ANA
ANA M A = A AND Mc
2050
ORA R A = A OR R ORA B
ORA M A = A OR Mc ORA
OPCODE OPERAND DESTINATION EXAMPLE
2050
XRA
XRA M A = A XOR Mc
2050
In the table,
R stands for register
M stands for memory
Mc stands for memory contents
Applications :
Data processing: The logical instructions in the 8085 microprocessor are used to
manipulate and process data stored in memory or registers. These instructions are used to
perform various logical operations, such as AND, OR, XOR, and complement, which are
used to filter, mask, and manipulate data in various ways.
Control systems: The logical instructions are used in control systems to perform logical
operations on sensor data and other inputs. These operations are used to generate control
signals that regulate the behavior of the system.
Signal processing: The logical instructions in the 8085 microprocessor are used in digital
signal processing applications, such as audio and image processing. These instructions are
used to perform various logical operations on the digital signal data, such as masking,
filtering, and thresholding.
Communication systems: The logical instructions are used in communication systems to
perform logical operations on data, such as error detection and correction, and
encryption/decryption.
Gaming: The logical instructions are used in gaming applications to perform logical
operations on game data, such as collision detection, pathfinding.
Advantages:
1. Efficient logical operations: The logical instructions in the 8085 microprocessor can
perform logical operations quickly and efficiently, making it suitable for applications
that require fast logical operations.
2. Reduced memory access: The use of registers and the accumulator in the 8085
microprocessor can help reduce the number of memory accesses required during logical
operations, which can improve the overall performance of the system.
3. Simplifies programming: The logical instructions in the 8085 microprocessor simplify
programming by providing a set of dedicated instructions for performing logical
operations.
4. Supports a wide range of operations: The logical instructions in the 8085
microprocessor support a wide range of operations, including AND, OR, XOR, and
complement operations.
Disadvantages:
1. Limited precision: The 8085 microprocessor uses 8-bit registers and logical
operations, which limits the precision of calculations that can be performed. This can be
a disadvantage for applications that require high precision logical operations.
2. Limited range of operations: Although the 8085 microprocessor supports a wide range
of logical operations, it does not support advanced operations such as trigonometric
functions or complex numbers.
3. Limited memory access: Although the use of registers can reduce the number of
memory accesses required, the limited number of registers in the 8085 microprocessor
can restrict the amount of data that can be manipulated at any given time.
4. Complex addressing modes: The addressing modes used in the logical instructions can
be complex, which can make programming more difficult.
Read related post: Arithmetic instructions in 8085 microprocessor
Branching instructions in 8085 microprocessor
Last Updated : 07 May, 2023
1. Jump Instructions – The jump instruction transfers the program sequence to the
memory address given in the operand based on the specified flag. Jump instructions are 2
types: Unconditional Jump Instructions and Conditional Jump Instructions.
(a) Unconditional Jump Instructions: Transfers the program sequence to the described
memory address.
OPCOD
E OPERAND EXPLANATION EXAMPLE
(b) Conditional Jump Instructions: Transfers the program sequence to the described
memory address only if the condition in satisfied.
OPCOD
E OPERAND EXPLANATION EXAMPLE
2. Call Instructions – The call instruction transfers the program sequence to the memory
address given in the operand. Before transferring, the address of the next instruction after
CALL is pushed onto the stack. Call instructions are 2 types: Unconditional Call
Instructions and Conditional Call Instructions.
(a) Unconditional Call Instructions: It transfers the program sequence to the memory
address given in the operand.
OPCOD
E OPERAND EXPLANATION EXAMPLE
Unconditionally
CALL address CALL 2050
calls
(b) Conditional Call Instructions: Only if the condition is satisfied, the instructions
executes.
OPCOD
E OPERAND EXPLANATION EXAMPLE
Advantages:
Disadvantages:
Limited branching range: The 8085 microprocessor has a limited branching range, which
can restrict the amount of memory that can be accessed. This can be a disadvantage for
applications that require a large number of branching instructions.
Limited number of condition codes: The 8085 microprocessor has a limited number of
condition codes, which can restrict the types of conditions that can be tested.
Complex addressing modes: The addressing modes used in the branching instructions can
be complex, which can make programming more difficult.
Limited instruction set: The 8085 microprocessor has a limited instruction set, which can
limit the types of branching instructions that can be used. This can be a disadvantage for
applications that require complex program flow.
Applications :
Looping: Branching instructions such as JMP, JZ, JNZ, JC, and JNC are used to implement
loops in programs. This allows the program to repeat a set of instructions until a specific
condition is met.
Decision-making: Conditional branching instructions are used to implement decision-
making in programs. This allows the program to make decisions based on the current state
of the microprocessor and branch to different parts of the program accordingly.
Subroutine calls: Call instructions, such as CALL and RET, are used to call subroutines in
programs. This allows the program to reuse code and execute common tasks in a modular
manner.
Interrupt handling: Branching instructions are used in interrupt handling to transfer
control to an interrupt service routine. This involves branching to a different part of the
program to handle the interrupt, and then returning to the main program after the interrupt
is serviced.
Program flow control: Branching instructions are used to control the flow of programs by
transferring control to different parts of the program based on specific conditions or events.
This allows the program to execute specific tasks at specific times and in a specific order.