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

📄 irq3.asm

📁 这是一个在凌阳单片机上实现一个具有时钟显示和播报、播放音乐并跳舞、对机器人前进计时、避障等功能的机器人的程序
💻 ASM
字号:
.include hardware.inc
.include s480.inc
.include bsrSD.inc
.include robot.inc
.public _IRQ3
.external _Robot_Go1
.external _Robot_Backup
.external _Robot_TurnRight
.external _PlaySnd
.external _RobotSystemInit
.external _Delay
.text
_IRQ3:
push r1,r5 to [sp]
r1=C_IRQ3_EXT2 
test r1,[P_INT_Ctrl]
jnz EXT2

EXT1:
r1=C_IRQ3_EXT1
[P_INT_Clear]=r1
r1=[R_InterruptStatus]
r1&=0xfcff
[R_InterruptStatus]=r1
[P_INT_Ctrl]=r1
r1=KAV
push r1 to [sp]
call _PlaySnd
pop  r1 from [sp]
r1=500
push r1 to [sp]
call _Delay
pop  r1 from [sp]
r1=ZHAOHUOLA
push r1 to[sp]
call _PlaySnd
pop r1 from [sp]
call _RobotSystemInit
r1=1
push r1 to [sp]
call _Robot_Backup
pop r1 from [sp]
r1 = 0x0001
[0x7012] = r1
call _RobotSystemInit
pop r1,r5 from [sp]
reti

EXT2:
r1=C_IRQ3_EXT2 
[P_INT_Clear]=r1
r1=[R_InterruptStatus]
r1&=0xfcff
[R_InterruptStatus]=r1
[P_INT_Ctrl]=r1
r1=KAV
push r1 to [sp]
call _PlaySnd
pop  r1 from [sp]
r1=500
push r1 to [sp]
call _Delay
pop  r1 from [sp]
r1=YOUZHANGAI
push r1 to[sp]
call _PlaySnd
pop r1 from [sp]
call _RobotSystemInit
r1=1
push r1 to [sp]
call _Robot_Backup
call _RobotSystemInit
call _Robot_TurnRight
call _RobotSystemInit
call _Robot_Go1
call _RobotSystemInit
pop r1 from  [sp]
r1 = 0x0001
[0x7012] = r1
pop r1,r5 from [sp]
reti




⌨️ 快捷键说明

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