📄 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 : 2004-11-13
; Description : The program is to detect and show the point of zero-cross of AC220V.
;
; 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 Zero_Detect.asm ;Detect and show the point of zero-cross of AC220V
;**********************************************************************************
;* *
;* Power on Reset Process *
;* *
;**********************************************************************************
V_Reset:
sei ;Disable interrupt
ldx #C_STACK_BOTTOM ;Initial stack pointer at $00ff
txs ;Transfer to stack point
jsr F_IRQ0_Init ;Init IRQ0 interrupt
jsr F_IO_Init ;Init PF5~PF0 as output
cli
?L_Main_Loop: ;The example for test
nop ;Waiting for IRQ0 interrupt
jmp ?L_Main_Loop
;**********************************************************************************
;* *
;* Interrupt Vector Table *
;* *
;**********************************************************************************
V_IRQ:
pha
lda P_INT_Flag0
and #C_INT_IRQ0IF ;IRQ0 INT comming?
bne ?L_IRQ0 ;Yes
jmp L_IntExit
;--------------------------------------------
;IRQ0 interrupt process
;--------------------------------------------
?L_IRQ0:
jsr F_Light
L_IntExit:
lda #$FF
sta P_INT_Flag0 ;Clear INT request flag
pla
rti
V_NMI:
rti
VECTOR: .SECTION
;**********************************************************************************
;* *
;* Interrupt Vector Table *
;* *
;**********************************************************************************
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 + -