Saturday, April 30, 2016

8051 Program – find out of range data

; find out of range data
; given block of 100h to 200h.
; Find out how many bytes from this block are
; greater then the number in r2 and less then number in r3.
; Store the count in r4.
ORG 0H
MOV R2, #70
MOV R3, #50
MOV DPTR, #0100H
MOV R7, #0FFH
MOV R4, #00H
MOV 20H, R2
MOV 21H, R3
NEXT: MOVX A, @DPTR
CJNE A, 21H, LOWER
SJMP OUT
LOWER: JNC OUT
CJNE A, 20H, LIMIT
SJMP OUT
LIMIT: JC OUT
INC R4
OUT: INC DPTR
DJNZ R7, NEXT
END



Related topics:
8051 Program - ones and twos complement   |   8051 Program - check for NULL   |   8051 Program - check nth bit of a byte   |   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