
277
REVIEW QUESTIONS
; Name: DELAY
; Function: when called, would generate a delay of 1 millisecond.
; Input: none
; Output: none
; Calls: none
; Uses: R0
DELAY: ACALL DELAY1 ; delay for 500 microseconds
DELAY1: MOV R0, #0FAH ; count of 250d
DELAY2: DJNZ R0, DELAY2 ; loop for 500 microseconds
RET
Note that how by calling the routine itself, the delay is doubled.
Keys are most widely used input devices and are of various
types such as capacitance type, membrane type and
mechanical contact type. In general, they are interfaced
with input ports in such a manner so that a key contact
generates logic low and a key release generates logic ...