⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blnkdly.asm

📁 于ADuC812的智能无功补偿控制器的研制 一种眼科B型超声诊断议 SL11R单片机外部存储器扩展 单片机复位电路...支持键盘双击事件的C程序设计! 一些源程序 FrankLin C51 库函数的一
💻 ASM
字号:
;======================================================================
;
; Author        : ADI - Apps
;
; Date          : Febuary 2001
;
; Filename      : bdelay.asm
;
; Hardware      : ADuC814 
;
; Description   : Blinks LED continuously.
;                 200mSec period @ 50% duty cycle.
;		  Pressing Int0 delays LED toggle rate by 200mSec
;
;======================================================================
;       
$MOD814            			; Use ADuC814 predefined Symbols

LED     EQU     P3.3            	; P3.3 is red LED on eval board
FLAG	BIT	00H			; define Flag variable

CSEG					; Defines the following as a segment of code

ORG     0000H				; Load Code at '00H'	

		JMP     MAIN		; Jump to MAIN

;======================================================================

ORG 0003h				; (INT0 ISR)
		INC 	A		; Increment Acc
		RETI			; Return from Interrupt

;======================================================================

					; Subroutines
;------------------------------------------------------------------

DELAY:					; Delays by 100ms * A
					; 100mSec based on 2.097152MHZ 
					; Core Clock 
					; i.e. default ADuC814 Clock

		MOV	R1,A		; Acc holds delay variable
 DLY0:		MOV	R2,#022h	; Set up delay loop0
 DLY1:		MOV	R3,#0FFh	; Set up delay loop1
		DJNZ	R3,$		; Dec R3 & Jump here until R3 is 0
		DJNZ	R2,DLY1         ; Dec R2 & Jump DLY1 until R2 is 0
		DJNZ	R1,DLY0		; Dec R1 & Jump DLY0 until R1 is 0
		RET			; Return from subroutine
;======================================================================

MAIN:						; (main program)

		MOV	SP,#02Fh		; Initialize SP
		SETB	IT0			; INT0 edge triggered
		SETB	EA			; enable inturrupts
		SETB	EX0			; enable INT0
	
		CLR	FLAG			; Clear Bit defined as FLAG
	
		MOV	A,#01H			; Initialize A -> 1
BLINK:		CPL	LED		; blink LED using compliment instruction
		CALL	DELAY			; Jump to subroutine DELAY
		JNB	FLAG,BLINK		; If FLAG is still cleared the jump to Blink

END



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -