📄 timer1init.s
字号:
.module Timer1init.c
.area text
_Timer1init::
; #include"gp32c.h"
; #define TSTOPBit 5 //定时器计数停止位
; void Timer1init(void)
; {
; //允许溢出中断、不启动计数、分频因子=64
; T1SC=0b01100110;
lda #102
sta 0x20
; //计数寄存器初值=0x0000
; T1CNTH=0x00; T1CNTL=0x00;
clr 0x21
clr 0x22
; //1秒产生1次溢出中断,计数寄存器=1×(2457600/64)=9600
; T1MODH=0x96; T1MODL=0x00;
lda #-106
sta 0x23
clr 0x24
; //允许定时器1计数寄存器计数
; T1SC&=~(1<<TSTOPBit);
bclr #5,0x20
L1:
.dbline 0 ; func end
rts
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -