📄 main.asm
字号:
;ZY13DSP12BD CONTROL Digital LED
;Mr Li Xiao Bei
;Hu Bei Zhong You
;2004.4.16
;LED Display
;======================== main.asm =========================
;
.mmregs
.def _c_int00
.include c54.inc
.ref c54init
;数码管地址
Digital0 .set 0x0010
Digital1 .set 0x0011
Digital2 .set 0x0012
Digital3 .set 0x0013
Digital4 .set 0x0014
Digital5 .set 0x0015
Digital6 .set 0x0016
Digital7 .set 0x0017
.data
DATA: .word 80FCH,8060H,80DAh,80F2h,8066H,80B6H,80BEH,80BEH;80E0H ;测试数据
.sect "progsys"
.align 0x10
_c_int00:
STM #0x0f80,SP
CALL c54init
LD #DATA ,DP
LOOP:
STM #DATA+7,AR1
PORTW *AR1-,Digital7
CALL Delay
PORTW *AR1-,Digital6
CALL Delay
PORTW *AR1-,Digital5
CALL Delay
PORTW *AR1-,Digital4
CALL Delay
PORTW *AR1-,Digital3
CALL Delay
PORTW *AR1-,Digital2
CALL Delay
PORTW *AR1-,Digital1
CALL Delay
PORTW *AR1-,Digital0
CALL Delay
B LOOP
Delay:
STM #999,AR3 ;循环次数1000
LOOP1: STM #9, AR2 ;循环次数10
LOOP2: BANZ LOOP2,*AR2- ;如果AR2不等于0,AR2减1,再判断
BANZ LOOP1,*AR3- ;如果AR1不等于0,AR1减1,跳转到LOOP1
RET
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -