📄 blockcmp.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.
;==================================================================================
;==================================================================================
; Program Name : BlockCmp.asm
; Description : This program presents that compares the contents of one block
; with another.
; Reference : SPMC65P2404A/2408A Data Sheet
; Revision history :
;----------------------------------------------------------------------------------
; Version Date Description
; 1.0.0 2004-9-9 First Edition
;==================================================================================
.SYNTAX 6502 ;process standard 6502 addressing syntax
.LINKLIST ;generate linklist information
.SYMBOLS ;generate symbolic debug information
;************************************************************************************
C_LIB_DEF EQU 1
.INCLUDE AN_O0100.inc ;Define external variable
;**********************************************************************************
.PAGE0
.DATA ;define data storage section
;**********************************************************************************
.CODE
;==================================================================================
; Function: F_BlockCmp
; Description: compares the contents of one block with another
; Input: X------------------the size of block
; GB_SourceAddr------starting address of blockX
; GB_TargetAddr------starting address of blockY
; Output: Z------if the two block is equal,Z=1; else 0.
; Destroy: A,X,Y
; Stacks: 1
;==================================================================================
.PUBLIC F_BlockCmp
F_BlockCmp:
ldy #0
?L_Cmp_Loop:
lda (GB_SourceAddr),y ;reach data from blockX
cmp (GB_TargetAddr),y ;compare data with blockY,equal?
bne ?L_NotSame ;no
iny
dex ;compare end?
bne ?L_Cmp_Loop ;no
lda #0 ;two block are same ,Z=1.
jmp ?L_Cmp_End
?L_NotSame:
lda #1 ;two block are not same,Z=0.
?L_Cmp_End:
rts
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -