Académique Documents
Professionnel Documents
Culture Documents
Asm
Asm
$NOMOD51
$INCLUDE (80C52.MCU)
;====================================================================
; DEFINITIONS
;====================================================================
;====================================================================
; VARIABLES
;====================================================================
;====================================================================
; RESET and INTERRUPT VECTORS
;====================================================================
; Reset Vector
;====================================================================
; CODE SEGMENT
;====================================================================
; * * * * * * * * * * * * * * * * * * * * * * * *
; retardo de 500 micro segundos (500us)
; * * * * * * * * * * * * * * * * * * * * * * * *
; tiempo = sec * 12 periodos
; 12MHz 1 ciclo de maquina
; * * * * * * * * * * * * * * * * * * * * * * * *
; tiempo = 0.5 s = 500000us
; ciclos de maquina
; * * * * * * * * * * * * * * * * * * * * * * * *
retardo: ;(2) = 2
mov r6,#0fah ;(1) = 1
xx: mov R7,#0f9h ;(1)*r6[250] = 250
nop ;(1)*r6(250) = 250
nop ;(1)*r6(250) = 250
nop ;(1)*r6(250) = 250
nop ;(1)*r6(250) = 250
nop ;(1)*r6(250) = 250
xxx: nop ;(1)*r6[250]*r7[249] = 62250
nop ;(1)*r6[250]*r7[249] = 62250
nop ;(1)*r6[250]*r7[249] = 62250
nop ;(1)*r6[250]*r7[249] = 62250
nop ;(1)*r6[250]*r7[249] = 62250
nop ;(1)*r6[250]*r7[249] = 62250
djnz R7,xxx ;(2)*r6[250]*r7[249] = 124500
djnz r6,xx ;(2)*r6[250] = 500
ret ;(2) = 2
; ----------------------------------
end