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 |
Discussion:
6 comments Page 1 of 1.
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.
A having 1111 1111.
P2 having 1111 1111.
Here p2.3 is setting.
Sushant raje said:
8 years ago
Thanks @Sruthi.
Asis Sahoo said:
9 years ago
JB <bit>, <rel addr> means jump if bit = 1.
JNB <bit>, <rel addr> means jump if bit !=1.
JNB <bit>, <rel addr> means jump if bit !=1.
Sakul said:
1 decade ago
JNB is JUMP if Not set then how come the answer is true? As question is about set JB.
Punith said:
1 decade ago
JNB- jump if bit not set.
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).
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).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers