Presentation on theme: "AMIE NBCAFE VIDEO TUTORIAL ON W HAT IS A FLAG OF A M ICROPROCESSOR 8085 AND ROLE OF IT ? Lecture by Subham Dutta See at www.amienbcafe.blogspot.comwww.amienbcafe.blogspot.com."— Presentation transcript:
W HAT IS A FLAG ? Flag is a 8 bit special kind of register in 8085 Microprocessor. We can say Flag is a brain of a Microprocessor In 8 bit register only 5 bit are occupied by 5 flag rest are don’t care condition
N AME OF F LAGS IN 8085 ? In 8085 there are 5 flags Sign : set (1) for negative, reset (0) for positive. Zero :set (1) for register containing value zero, reset (0) for register containing value Non-zero. Auxiliary Carry :set (1) for Auxiliary Carry Generated, reset (0) for Auxiliary Carry not Generated. Parity: set (1) for data in register containing even number of one, reset (0) for data in register containing odd number of one. Carry : Carry :set (1) for Carry Generated, reset (0) for Carry not Generated.
H OW FLAGS ARE SET OR RESET IN 8085? Take 05h in accumulator and 03h in register b Add them ( a+b ) Result will store in accumulator ( a = 08h ( In binary ) See the flags position. Now take a = 02h and b = 05h Subtract them Result will store in accumulator ( a = (-) FC ) ( In binary ) See the flags position
I MPORTANT THINGS TO REMEMBER FOR FLAGS STATUS. Flag are generated after every logical and arithmetic instruction only ( not for data transfer operation ). We can know the status of any register by watching the flag status for that. Take a example mvi c 04h ( take 04 in c register) mvi a 05h ( take 05 in accumulator ) Loop2 sub c ( 1 st time result in accumulator a= 1) jnc loop1 ( check the carry flag status according to accumulator data ) dcr c jnz loop2 ( check the Zero flag status according to register c data ) Loop1 hlt ( Stop )
T HANK YOU Visit for more video tutorialwww.amienbcafe.blogspot.com