📄 main.asm
字号:
;==================================================================================
; The information contained herein is the exclusive property of
; Sunplus Technology Co. And shall not be distributed, reproduced,
; or disclosed in whole in part without prior written permission.
; (C) COPYRIGHT 2004 SUNPLUS TECHNOLOGY CO.
; ALL RIGHTS RESERVED
; The entire notice above must be reproduced on all authorized copies.
;==================================================================================
;==================================================================================
; Project Name :
; Applied Body : SPMC65P2404A
; Firmware version:
; Programer :
; Date : 2005-5-10
; Description : play speech with PWM function
;
; Hardware Connect:
; Link File :
; IDE Version : V1.6.5
; BODY Version : V1.0.0A
;==================================================================================
.SYNTAX 6502 ;Process standard 6502 addressing syntax
.LINKLIST ;Generate linklist information
.SYMBOLS ;Generate symbolic debug information
;************************************************************************************
;* *
;* System Register Define *
;* *
;************************************************************************************
;************************************************************************************
.INCLUDE SPMC65P2404A.inc ;Define all hardware,Registers and ports.
;************************************************************************************
;************************************************************************************
;* *
;* Data memory Define *
;* *
;************************************************************************************
.PAGE0 ;Define values in the range from 00h to FFh
;************************************************************************************
.DATA ;Define data storage section
;************************************************************************************
;* *
;* Program Area *
;* *
;************************************************************************************
.CODE
.INCLUDE Access4096.asm
;************************************************************************************
;* *
;* Power on Reset Process *
;* *
;************************************************************************************
.PUBLIC V_Reset
V_Reset:
sei ;Disable interrupt
ldx #C_STACK_BOTTOM ;Initial stack pointer at $00FF
txs ;Transfer to stack point
jsr F_ClrRAM ;clear the RAM
jsr F_SPR4096_Initial ;Initialize the timer and IO
L_MainLoop:
jsr F_RdCtrl ;get the size of the speech file
lda #C_WDT_Clr
sta P_WDT_Clr ;clear watch-dog
jmp L_MainLoop
;************************************************************************************
;* *
;* Interrupt Service Process *
;* *
;************************************************************************************
V_IRQ:
pha
txa
pha
tya
pha
lda P_INT_Flag1
and #C_INT_T2OIF ;CAP3 INT?
beq ?L_IRQ_Rts ;NO
lda #$FF
sta P_INT_Flag1
;--------------------------------------------------------
;CAP1 interrupt process service
lda #0
sta P_TMR0_1_Ctrl0 ;disable PWM
lda GB_Rd_Buf
sta P_TMR1_PWMDuty ;duty low byte
lda #C_T112B_PWM ;Set Timer1 is 12-bit PWM
sta P_TMR0_1_Ctrl0
jsr F_GetData ;get the speech resource from SPR4096
lda #$FF
sec
sbc GB_Rd_Buf
sta GB_Rd_Buf
?L_IRQ_Rts:
pla
tay
pla
tax
pla
rti
V_NMI:
rti
;************************************************************************************
;* *
;* Interrupt Vector Table *
;* *
;************************************************************************************
VECTOR .SECTION
DW V_NMI ;Non-mask interrupt vector(no use)
DW V_Reset ;Reset vector
DW V_IRQ ;IRQ interrupt vector
;************************************************************************************
;* *
;* End of Interrupt Vector Table *
;* *
;************************************************************************************
.END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -