
102
SUBROUTINES AND STACK
NEXT1: MOV A, P1 ; read thermal value through port P1
CLR C ; clear carry fl ag
SUBB A, #0AAH ; check for threshold
JC NEXT2 ; within limits, check next port
MOV P3, #55H ; limit crossed, raise alarm
NEXT2: MOV A, P2 ; read thermal value through port P2
CLR C ; clear carry fl ag
SUBB A, #0AAH ; check for threshold
JC NEXT3 ; within limits, check next port
MOV P3, #55H ; limit crossed, raise alarm
NEXT3: SJMP START ; loop on
is program would function properly and keep on checking all three ports in the same sequence and raising
an alarm, when the preset threshold limit of AAH exceeds.