Question

c) Briefly analyze the flag bits available on 8085. Develop an instruction sequence that can clear all the flag bits (So, Z0,

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Sign Flag (S): After any operation if the MSB of the result is 1, it indicates the number is negative and the sign flag becomes set, i.e. 1. If the MSB is 0, it indicates the number is positive and the sign flag becomes reset i.e. 0.

Zero Flag (Z) : After any arithmetical or logical operation if the result is 0, the zero flag becomes set i.e. 1, otherwise it becomes reset i.e. 0.

1- zero result
0- non-zero result

Auxiliary Carry Flag (AC): This flag is used in BCD number system(0-9). If after any arithmetic or logical operation generates any carry and passes on to bit 4 this flag becomes set i.e. 1, otherwise it becomes reset i.e. 0. This is the only flag register which is not accessible by the programmer

1-carry out from bit 3 on addition or borrow into bit 3 on subtraction
0-otherwise

Parity Flag (P): If after any arithmetic or logical operation the result has even parity, an even number of 1 bits, the parity register becomes set i.e. 1, otherwise it becomes reset i.e. 0.

1-accumulator has even number of 1 bits
0-accumulator has odd parity

Carry Flag (CY): Carry is generated when performing n bit operations and the result is more than n bits, then this flag becomes set i.e. 1, otherwise it becomes reset i.e. 0.
During subtraction (A-B), if A>B it becomes reset and if (A<B) it becomes set.
Carry flag is also called borrow flag.

1-carry out from MSB bit on addition or borrow into MSB bit on subtraction
0-no carry out or borrow into MSB bit

Instruction Sequence to clear all flag bits:

MVI B,0 ; B = 0

INR B    ; B = 1 (resets Sign, Zero, Parity and Auxiliary Carry flags)

STC      ; set Carry flag

CMC      ; complement Carry flag

The INR (Increment Register) instruction sets S, Z, P and AC flags according to the result of the increment. 1 is positive and not zero, so the S and Z flags are reset. It has an odd number of '1' bits so P is reset, and there is no carry from bit 3 so AC is reset.

INR does not affect the Carry flag, so we must reset it separately. Unfortunately the 8085 does not have a 'reset carry' instruction, but it does have set carry and complement carry.

Add a comment
Know the answer?
Add Answer to:
c) Briefly analyze the flag bits available on 8085. Develop an instruction sequence that can clear all the flag bits (S...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Its logic design my sequence is 127605 i need help with all this pages please and thank you

    Its logic design my sequence is 127605 i need help with all this pages please and thank you 27 60 Experiment 4 Six-State Up-Down Counter 1 Objective To become familiar with the design procedures of a counter, which are applicable to the design of other synchronous sequential circuits. 2 Problem description A six-state up-down counter is to be designed. Three flip-flops with outputs Q2,Qi and Qo are required in the design. As shown in Figure 1, the counter is initialized...

  • The Ace Manufacturing Company has orders for three similar products: Product Order (Units) A 1750 B 500 C 1100 Three machines are available for the manufacturing operations. All three mach...

    The Ace Manufacturing Company has orders for three similar products: Product Order (Units) A 1750 B 500 C 1100 Three machines are available for the manufacturing operations. All three machines can produce all the products at the same production rate. However, due to varying defect percentages of each product on each machine, the unit costs of the products vary depending on the machine used. Machine capacities for the next week and the unit costs are as follows: Machine Capacity (Units)...

  • Edit a C program based on the surface code(which is after the question's instruction.) that will...

    Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....

  • Please develop the following code using C programming and using the specific functions, instructi...

    Please develop the following code using C programming and using the specific functions, instructions and format given below. Again please use the functions given especially. Also don't copy any existing solution please write your own code. This is the first part of a series of two labs (Lab 7 and Lab 8) that will complete an implementation for a board-type game called Reversi (also called Othello). The goal of this lab is to write code that sets up the input...

  • Question 11 According to Alberta Employment Standards, all of the following are true in respect of...

    Question 11 According to Alberta Employment Standards, all of the following are true in respect of overtime except one. Identify the EXCEPTION Not yet answered Marked out of 1.00 Select one: a. An overtime agreement allows overtime hours to be banked and later taken off with pay. Time off with pay, is banked at a rate of 1.5 hours for every overtime hour worked. b. Some employers and employees agree to replace overtime pay with time off with pay. c....

  • Bexter Labs produces three products: A, B, and C. Bexter can sell up to 2000 units...

    Bexter Labs produces three products: A, B, and C. Bexter can sell up to 2000 units of Product A, up to 3000 units of Product B, and up to 5000 units of Product C. Each unit of Product C uses two units of A and three units of B and incurs $7 in processing costs. Products A and B are produced from either raw material 1 or raw material 2. It costs $9 to purchase and process one unit of...

  • Major Homework #2 Implement a C program major_hw2.c to solve the 15-puzzle problem using the A* s...

    Major Homework #2 Implement a C program major_hw2.c to solve the 15-puzzle problem using the A* search algorithm. Please include pictures that the code runs and shows the different states as it reaches goal state please. 1. Objectives • To gain more experience on using pointers and linked lists in C programs. • To learn how to solve problems using state space search and A* search algorithm. 2. Background A* search and 15-puzzle problem have been introduced in the class....

  • Can you please help me with creating this Java Code using the following pseudocode? Make Change C...

    Can you please help me with creating this Java Code using the following pseudocode? Make Change Calculator (100 points + 5 ex.cr.)                                                                                                                                  2019 In this program (closely related to the change calculator done as the prior assignment) you will make “change for a dollar” using the most efficient set of coins possible. In Part A you will give the fewest quarters, dimes, nickels, and pennies possible (i.e., without regard to any ‘limits’ on coin counts), but in Part B you...

  • Learning Goal: Develop problem-solving skills wing chemical equilibria and oplying Le Chatter's principle Solving problems with...

    Learning Goal: Develop problem-solving skills wing chemical equilibria and oplying Le Chatter's principle Solving problems with chemical equilibrium If you know the basic principles of chemical equilibrium, you can analyze and predict reversible reactions. To analyze any reversible reaction, follow these problem-solving steps: 1. Identify the reactants and products for the given chemical reaction. 2. Draw a diagram of the reaction to better understand what is happening 3. Identify how increasing or decreasing a product or reactant stresses the equilibrium...

  • Summary should briefly analyze the central problems and issues of the case and provide some analysis...

    Summary should briefly analyze the central problems and issues of the case and provide some analysis and suggestions. Thank you. Lean Initiatives and Growth at Orlando Metering Company It was late August 2002 and Ed Cucinelli, vice president of Orlando Metering Company (OMC), sat in his office on a late Saturday morning. He had come in to prepare for some strategic planning meetings that were scheduled for the upcoming week. As he noticed the uncommon silence in the building, Ed...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT