Digital Electronics - The 8051 Microcontroller - Discussion

Discussion Forum : The 8051 Microcontroller - General Questions (Q.No. 31)
31.
This program code will read data from port 0 and write it to port 2, and it will stop looping when bit 3 of port 2 is set:
STAT: MOV A, PO
 MOV P2,A
 JNB P2.3, STAT
True
False
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
6 comments Page 1 of 1.

Sruthi said:   1 decade ago
Because

1st step: Reads data frm port0
2nd step: Writes data to port2
3rd step: It checks for bit 3 of port2 if it z '0' it will go to stat label this repeats until bit 3 sets.

JNB means jump if not bit(means it cheks whether that particular bit zero or not).

Punith said:   1 decade ago
JNB- jump if bit not set.

Sakul said:   1 decade ago
JNB is JUMP if Not set then how come the answer is true? As question is about set JB.

Asis Sahoo said:   9 years ago
JB <bit>, <rel addr> means jump if bit = 1.
JNB <bit>, <rel addr> means jump if bit !=1.

Sushant raje said:   8 years ago
Thanks @Sruthi.

Divya said:   8 years ago
By default p0, p1, p2and p3 having FF means 1111 1111.

A having 1111 1111.

P2 having 1111 1111.

Here p2.3 is setting.

Post your comments here:

Your comments will be displayed after verification.