Quick links
Latest articles
Internship
Members
New...
Algorithms
Discrete Mathematics
Big data
Languages
C
C++
C++ STL
Java
Data Structure
C#.Net
Android
Kotlin
SQL
Web
PHP
Python
JavaScript
CSS
Ajax
Node.js
Web prog.
Programs
C
C++
DS
Java
C#
Python
Aptitude
C
C++
Java
DBMS
Interview
C
Embedded C
Java
SEO
HR
CS Subjects
CS Basics
O.S.
Networks
DBMS
Embedded Systems
Cloud Computing
Machine learning
CS Organizations
Linux
DOS
More...
Articles
Puzzles
News/Updates

Home » Embedded Systems

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.MNEMONICSCOMMENTS
1MVI A, 00A ← 00
2ANI 00A AND 00
3XRA A A XOR A
4SUB A A ← A – A

Explanation:

  1. MVI A, 00: instruction copies 00 to A.
  2. 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.
  3. 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.
  4. 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.MNEMONICSCOMMENTS
1MOV AX, 0000AX ← 0000
2AND AX, 0000AX ← AX AND 0000
3XOR AX, AXAX ← AX XOR AX
4SUB AX, AXAX ← AX – AX

Explanation: Register AX is used.

  1. MOV AX, 0000: copies 0000 to AX.
  2. AND AX, 0000: operation performs bit by bit ANDs the source operand (0000) to the destination operand and store the result in AX.
  3. 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.
  4. 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.





Quick links:
C FAQ(s) C Advance programs C/C++ Tips & Tricks Puzzles JavaScript CSS Python Linux Commands PHP Android Articles More...

Featured post:
Introduction to Linux (Its modes, Safety, Most popular Applications)
Linux Best Distribution Software (Distros) of 2018

Was this page helpful? Please share with your friends...

Are you a blogger? Join our Blogging forum.

Comments and Discussions



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates



© https://www.includehelp.com (2015-2018), Some rights reserved.