Query regarding Microcontroller 8051

sparsh sharma
@sparsh-sharma-6HWmix • Oct 27, 2024

as in microprocessor we have zero flag in its Program Status Word to check the zero status but in microcontroller 8051 we don't have this type of flag in the PSW so my question is when the conditional jump instruction is executed in the microcontroller (instructions like DJNZ, JZ, JNZ), then how microcontroller decides that now the contents of register A has become zero without having the zero flag in its Program Status Word (PSW)??????

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Jeffrey Arulraj

    @jeffrey-xA7lUP • Sep 13, 2015

    The Zero Flag in MC8051 is not present.

    JNC, JC and all check the status of the Carry flag to do all the operations you have asked here for

    Have fun exploring 8051

  • sparsh sharma

    @sparsh-sharma-6HWmix • Sep 13, 2015

    Jeffrey SamuelThe Zero Flag in MC8051 is not present.

    DJNZ and all check the status of the Carry flag to do all the operations you have asked here for

    Have fun exploring 8051

    Thank you Sir, but i have one doubt that DJNZ means jump if contents of register A is not zero, so where is carry flag effected in DJNZ instruction, will you please clarify your answer.........

  • Jeffrey Arulraj

    @jeffrey-xA7lUP • Sep 13, 2015

    sparsh sharmaThank you Sir, but i have one doubt that DJNZ means jump if contents of register A is not zero, so where is carry flag effected in DJNZ instruction, will you please clarify your answer.........

    Sorry about that I made a small error I corrected it

  • sparsh sharma

    @sparsh-sharma-6HWmix • Sep 15, 2015

    Jeffrey SamuelSorry about that I made a small error I corrected it

    sir i just want to know that how microcontroller gets notification about the contents of accumulator

  • Harshad Italiya

    @harshad-ukH5ww • Sep 15, 2015

    sparsh sharmasir i just want to know that how microcontroller gets notification about the contents of accumulator

    I didn't get this question. Accumulator is part of Microcontroller itself. No need for microcontroller to get notification from accumulator.

  • sparsh sharma

    @sparsh-sharma-6HWmix • Sep 16, 2015

    Harshad ItaliyaI didn't get this question. Accumulator is part of Microcontroller itself. No need for microcontroller to get notification from accumulator.

    i mean as in case of microprocessor there is a zero flag which becomes high when accumulator contents become zero then why is it not present in the microcontroller

  • Harshad Italiya

    @harshad-ukH5ww • Sep 16, 2015

    sparsh sharmai mean as in case of microprocessor there is a zero flag which becomes high when accumulator contents become zero then why is it not present in the microcontroller

    Microprocessor and Microcontroller are two different things. 8051 is Microcontroller and 8051 has Zero flag.

    Sorry but I am still not getting things clear about your questions.

  • sparsh sharma

    @sparsh-sharma-6HWmix • Sep 19, 2015

    Harshad ItaliyaMicroprocessor and Microcontroller are two different things. 8051 is Microcontroller and 8051 has Zero flag.

    Sorry but I am still not getting things clear about your questions.

    sir, my question is without any zero flag how microcontroller decides that now the contents of A-register has become zero ? like in case of carry instructions (jnc, jc etc) there is a carry flag to give indication about the carry. then why zero flag is not there.

  • Murthy Yayavaram

    @murthy-AIniYf • Dec 9, 2015

    Dear Friend, the Zero flag is an indication of status of CPU after some arithmetic operation.O.K. Normally in microprocessors, this status is used to implement some condition .While implementing the condition (for ex say branch condition) the CPU will check the status of this zero flag and act accordingly.But in the case of 8051 micro controller ,the accumulator can be made zero by other instructions also and the same status can be checked using J Z ,JNZ etc...So the controller can manage without zero flag also. hope I am clear ..