# Write the 8085 instructions which reset the accumulator

Here, we are going to learn the **instructions in 8085 Microprocessor which reset the accumulator**.

Submitted by Ayush Sharma, on November 05, 2018

**Problem 1:**

Write the 8085 instructions which reset the accumulator.

**Solution:** There are 4 instructions to reset the accumulator in 8085. These instructions are:

S.No. | MNEMONICS | COMMENTS |
---|---|---|

1 | MVI A, 00 | A ← 00 |

2 | ANI 00 | A AND 00 |

3 | XRA A | A XOR A |

4 | SUB A | A ← A – A |

**Explanation:**

**MVI A, 00:**instruction copies 00 to A.**ANI 00:**instruction performs bit by bit AND operation of source operand (i.e. 00) to the destination operand (i.e. the accumulator A) and store the result in accumulator A.**XRA A:**instruction performs XOR operation between source operand and destination operand and store the result in the accumulator. Here, source and destination operand both are same i.e. A. Therefore, the result after performing XOR operation, stored in the accumulator is 00.**SUB A:**operation subtracts the contents of source operand(here, source register is A) from the contents of accumulator and store the result in the accumulator itself. Since, the source and destination operand are same. Therefore, accumulator A = 00.

**Problem 2:** Write 8086 instructions which are used to reset accumulator.

**Solution:** There are 4 instructions in 8086 to reset the accumulator. These instructions are:

S.No. | MNEMONICS | COMMENTS |
---|---|---|

1 | MOV AX, 0000 | AX ← 0000 |

2 | AND AX, 0000 | AX ← AX AND 0000 |

3 | XOR AX, AX | AX ← AX XOR AX |

4 | SUB AX, AX | AX ← AX – AX |

**Explanation:** Register AX is used.

**MOV AX, 0000:**copies 0000 to AX.**AND AX, 0000:**operation performs bit by bit ANDs the source operand (0000) to the destination operand and store the result in AX.**XOR AX, AX:**performs the XOR operation in values of source register and destination register and store the result in AX. The source and destination operands, both are same. Therefore, AX = 0.**SUB AX, AX:**operation subtracts the value of source operand from the value of destination operand and store the result in AX. Here, both the operands are same .Therefore, AX = 0.

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.

Learn PCB Designing: PCB DESIGNING TUTORIAL