📄 blink.asm
字号:
;======================================================================
;
; Author : ADI - Apps
;
; Date : February 2001
;
; File : Blink.asm
;
; Description : Blink LED with 100mSec delay for MicroConverter DEMO
;
;======================================================================
;
$MOD814 ; Use 8052 predefined Symbols
CSEG ; Defines the following as a segment of code
ORG 0000H ; Load Code at '0'
JMP MAIN ; Jump to MAIN
ORG 004Bh ; Subroutines
;------------------------------------------------------------------
DELAY: ; Delays by 100ms * A
; 100mSec based on 2.097152MHZ
; Core Clock
; i.e. default ADuC814 Clock
MOV R0,A ; Acc holds delay variable
DLY0: MOV R1,#022h ; Set up delay loop0
DLY1: MOV R2,#0FFh ; Set up delay loop1
DJNZ R2,$ ; Dec R2 until R2 is zero
DJNZ R1,DLY1 ; Dec R1 & Jump DLY1 until R1 is 0
DJNZ R0,DLY0 ; Dec R0 & Jump DLY0 until R0 is 0
RET ; Return from subroutine
;======================================================================
MAIN: ; (main program)
MOV A,#01H ; Set up delay = A*100mSecs.
BLINK: CPL P3.3 ; blink LED using compliment instruction
CALL DELAY ; Call Software delay 100mS
JMP BLINK ; Jump to Blink
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -