?? 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-8-20
; Description : This program presents an example that transfer datas from source string
; to target string
;
; 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 *
;* *
;************************************************************************************
;---------------------------------
SPMC65P2404Ax .EQU 1
;---------------------------------
.INCLUDE SPMC65P2404A.inc ;Define all hardware,Registers and ports.
.INCLUDE LIB_VAR.inc ;Lib resource file
.INCLUDE AN_O0100.inc ;Lib inc file
;************************************************************************************
;************************************************************************************
;************************************************************************************
;* *
;* Data memory Define *
;* *
;************************************************************************************
.PAGE0 ;define values in the range from 00h to FFh
GB_String_copy1 DS 10 ;block1 indicated by [GB_Block1_Adr]
GB_String_copy2 DS 10 ;block2 indicated by [GB_Block2_Adr]
;************************************************************************************
.DATA ;define data storage section
;************************************************************************************
;* *
;* Program Area *
;* *
;************************************************************************************
.CODE
;************************************************************************************
;* *
;* Power on Reset Process *
;* *
;************************************************************************************
V_Reset:
sei ;Disable interrupt
ldx #C_STACK_BOTTOM ;Initial stack pointer at $00ff
txs ;Transfer to stack point
;the example for test
;***************************
lda #0x10 ;full GB_String_copy1
ldx #0x00
?L_test_loop:
lda T_test,x
sta GB_String_copy1,x
inx
cpx #10
bne ?L_test_loop
?L_test_end:
;***************************
lda #.low.GB_String_copy2
sta GB_String_source
lda #.high.GB_String_copy2
sta GB_String_source+1 ;address send to soure address
lda #.low.GB_String_copy1
sta GB_String_targer
lda #.high.GB_String_copy1
sta GB_String_targer+1 ;address send to target address
L_Main_Loop:
jsr F_Stringcopy ;transfer datas from source to target
jmp L_Main_Loop
T_test:
.DB 1,2,3,4,0,6,7,8,9,0
;************************************************************************************
;* *
;* Interrupt service process *
;* *
;************************************************************************************
V_IRQ:
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 + -