CrazyEngineers
  • Query regarding Microcontroller 8051

    sparsh sharma

    sparsh sharma

    @sparsh-sharma-6HWmix
    Updated: Oct 27, 2024
    Views: 1.2K
    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)??????
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Jeffrey Arulraj

    MemberSep 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
    Are you sure? This action cannot be undone.
    Cancel
  • sparsh sharma

    MemberSep 13, 2015

    Jeffrey Samuel
    The 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.........
    Are you sure? This action cannot be undone.
    Cancel
  • Jeffrey Arulraj

    MemberSep 13, 2015

    sparsh sharma
    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.........
    Sorry about that I made a small error I corrected it
    Are you sure? This action cannot be undone.
    Cancel
  • sparsh sharma

    MemberSep 15, 2015

    Jeffrey Samuel
    Sorry 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
    Are you sure? This action cannot be undone.
    Cancel
  • Harshad Italiya

    MemberSep 15, 2015

    sparsh sharma
    sir 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.
    Are you sure? This action cannot be undone.
    Cancel
  • sparsh sharma

    MemberSep 16, 2015

    Harshad Italiya
    I 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
    Are you sure? This action cannot be undone.
    Cancel
  • Harshad Italiya

    MemberSep 16, 2015

    sparsh sharma
    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
    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.
    Are you sure? This action cannot be undone.
    Cancel
  • sparsh sharma

    MemberSep 19, 2015

    Harshad Italiya
    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.
    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.
    Are you sure? This action cannot be undone.
    Cancel
  • Murthy Yayavaram

    MemberDec 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 ..
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register