;using AT89C51 with XTAL 12 MHz'
org 0x0
Repeat:
mov A, #55H
mov P0, A
mov P1, A
mov P2, A
ACALL Delay ;ACALL take two bytes - 11 bits are used for address. LCALL takes 3 bytes
;For ACALL target address of subroutine should lie within 2K bytes
mov A, #0AAH
mov P0, A
mov P1, A
mov P2, A
ACALL Delay
SJMP Repeat
;-------Delay Subroutine
;period of one MC = 0.001 ms
;75(50(255x2x0.001)) = 1912.5 ms = 2 s
org 0x300
Delay:
mov R0, #75 ;1 MC
L1: mov R1, #50
L2: mov R2, #255
L3: DJNZ R2, L3 ;2 MC
DJNZ R1, L2
DJNZ R0, L1
RET ;2 MC
end