; check for NULL
ORG 0H
DATA1 EQU 10
MAIN:
MOV A,#DATA1
MOV R1,#0
LCALL CHECK
MOV R1,#DATA1
LCALL CHECK
SJMP MAIN
CHECK:
SUBB A, R1
JNZ notnull ; jump if A is not zero
CLR P1.0 ; P1.0 = low
SJMP here
notnull:
SETB P1.0 ; P1.0 = high
here: RET
END
Related topics:
8051 Program - find out of range data | 8051 Program - ones and twos complement | 8051 Program - check for NULL | 8051 Program - 1ms delay | 8051 Program - 1sec delay timer | 8051 Program - memory subroutines | 8051 Program - math subroutines | 8051 Program - conversion subroutines
List of topics: 8051
No comments:
Post a Comment