Professional Documents
Culture Documents
DE-43 Mechatronics
Syndicate – B
LAB REPORT
Week#5 AT89C51 Controller and Keil µVision
Page 1 of 6
Microcontroller and Embedded Systems (MTS - 311) LAB REPORT
Introduction:
In this lab, we learned compare instructions like CJNE, JNC, and JC. We learned how
these commands operate and how they are used in Keil µVision by doing tasks.
Objective:
To be able to use conditions and make decisions using the CJNE command on Keil.
To be able to write a code that compares two values and stores data accordingly.
Compare Instructions:
When it comes to assembly language the compare instructions act like an if-else
statement used in c programming, the CJNE command compares the two numbers and updates
the carry bit accordingly, using which we can compare two numbers and make logical
decisions.
JNC:
This command is called jump if not carry which means it would operate when there is
0 stored in the carry bit.
JC:
This command is called jump if carry, it operates when there is 1 stored in the carry bit.
Page 2 of 6
Microcontroller and Embedded Systems (MTS - 311) LAB REPORT
Sample code:
Page 3 of 6
Microcontroller and Embedded Systems (MTS - 311) LAB REPORT
Page 4 of 6
Microcontroller and Embedded Systems (MTS - 311) LAB REPORT
Conclusion:
At the end of this lab, we were able to make a logical code that helped compare numbers
and make decisions using the CJNE, JC, and JNC compare instructions.
Page 6 of 6