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

📄 dicadd1.asm

📁 辞典 dict3.asm.grammar.asm,newword.asm 学习 learn.asm 名片 userinf.asm 备忘 userinf.asm 提醒 userinf
💻 ASM
📖 第 1 页 / 共 3 页
字号:
	cmp	#5
	beq	?_Finish
	jmp	?_matchmain
?_Finish:
	lda	#5
	rts

;;=====================================
;;function:比较连续的字符串
;;input:<wordpoint,<inputpoint,findbuff,cdict_result
;;output:a=0 不匹配 a!=0 匹配
;;=====================================
MatchcontinueChar:
?_Bigloop:
	ldy	<Inputpoint
	ldx	<WordPoint
	lda	Cdict_result,x
	beq	?_NOMatch
?_loop:
	lda	Findbuff,y
	cmp	#' '
	beq	?_comp
	cmp	#'a'
	bcc	?_FindMatch
?_comp:
	cmp	Cdict_result,x
	;beq	?_CompNextChar
	;inc	<WordPoint
	;bra	?_Bigloop
	bne	?_NOMatch1
?_CompNextChar:
	inx
	iny
	bra	?_loop
?_NOMatch:	;未找到相匹配的字符串
	lda	<InputPoint
	bne	?_NOMatch1
	lda	#5
	rts
?_NOMatch1:
	lda	#0
	rts
?_FindMatch:	;找到相匹配的字符串
	sty	<Inputpoint
	stx	<Wordpoint
	lda	#0ffh
	rts
;;=====================================
;;function:检查后面还有没有'*'号
;;input:无smb1  有rmb1
;;output:
;;=====================================
Gudge_LastStarMark:
?_loop:
	lda	findbuff,y
	beq	?_exit
	cmp	#'*'
	beq	?_exit1
	iny
	bra	?_loop
?_exit:
	smb1	<MatchFlag
	rts
?_exit1:
	rmb1	<MatchFlag
	rts

;;=====================================
;;function:清除连续的'*'
;;input:findbuff
;;output:findbuff
;;=====================================
ClearLianXuStarMarK:
?_loop2:
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'*'
	bne	?_loop
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'*'
	bne	?_loop

	tya
	tax
?_loop1:
	iny
	lda	findbuff,y
	sta	findbuff,x
	beq	?_loop2
	inx
	bra	?_loop1
?_exit:
	rts

;;====================================
;;fuction:整理解压结果(去掉重音,次重音把其他非英文转化为英文
;;--->去掉上下标
;;input:cdict_result
;;output:cdict_result
;;====================================
ClearUp_cdict_result:
	jsr	MatchstepOne
	jsr	MatchstepTwo
	jsr	MatchstepThree
	jsr	MatchstepFour
	jsr	MatchstepFive
	jsr	MatchstepSix
	jsr	MatchstepSeven
	jsr	MatchstepEight
	jsr	MatchstepNine
	jsr	MatchstepTen
	jsr	MatchstepEleven
	jsr	MatchstepTwelf
	rts



;;==============================================
;;function:将词条里出现的00~1dh 替换
;;input:
;;output:
;;==============================================
;replacecode1:
;        tax
;        lda     replacetab1,x
;        sta	cdict_result,y
;        rts
replacetab1:
        db      'aaaaaaaaaaaaacccceeeeeeiiiinnn',1eh,'l'

;;==============================================
;;function:将词条里出现的9ah~9fh 替换
;;input:
;;output:
;;==============================================
;replacecode2:
;        sec
;        sbc     #9ah
;        tax
;        lda     replacetab2,x
;        sta	cdict_result,y
;        rts
replacetab2:
        db      'ooouuu'

;;==============================================
;;function:将词条里出现的8bh~8dh 替换
;;input:
;;output:
;;==============================================
;replacecode3:
;        sec
;        sbc     #8bh
;        tax
;        lda     replacetab3,x
;	sta	cdict_result,y
;        rts
replacetab3:
        db      'stz'

;;======================================
;;function:保存解压前的信息
;;input:<indxd & <bitcount
;;output:
;;======================================
store_addrInf:
        lda     <indxd
        sta     firstlinebuff
        lda     <indxd+1
        sta     firstlinebuff+1
        lda     <indxd+2
        sta     firstlinebuff+2
        lda     <indxd+3
        sta     firstlinebuff+3
        lda     <bitcount
        sta     firstlinebuff+4
        rts

;;======================================
;;function:还原解压前的信息
;;input:<indxd & <bitcount
;;output:
;;======================================
Restore_addrInf:
        lda     firstlinebuff
        sta     <indxd
        lda     firstlinebuff+1
        sta     <indxd+1
        lda     firstlinebuff+2
        sta     <indxd+2
        lda     firstlinebuff+3
        sta     <indxd+3
        lda     firstlinebuff+4
        sta     <bitcount
        rts

;;====================================
;;function:在OY=15处划一横线
;;input:Heng_line
;;output:
;;====================================
DrawALineAt15:
	stz	<OX
	lda     #15
        sta     <OY
        jsr	LJSR
        dw	CatalogBank
        dw	DrawLine-1
;        lda     <CurX
;        pha
;        lda     <CurY
;        pha
;        stz     <OX
;        lda     #15
;        sta     <OY
;        loprintimage Heng_line
;        pla
;        sta     <CurY
;        pla
;        sta     <CurX
        rts

delay:
	pha
	phx
	phy
	ldx	#05h
?_2:
	ldy	#0ffh
?_1:
	lda	#0ffh
?_0:
	nop
	dec
	bne	?_0
	dey
	bne	?_1
	dex
	bne	?_2
	ply
	plx
	pla
	rts



;;====================================
;;function:整理findbuff
;;input:findbuff
;;output:findbuff
;;====================================
ClearUp_findbuff:
	bbs2	<Blackflag,?_HaveDenghao
	jsr	stepOne
	jsr	Steptwo
	jsr	stepthree
	jsr	stepfour
	jsr	stepfive
	jsr	Stepsix
	rts
?_HaveDenghao:
	jsr	StoreDenghaoChar
	jsr	DenghaostepOne
	jsr	DenghaostepTwo
	jsr	DenghaostepThree
	jsr	DenghaostepFour
	jsr	DenghaostepFive
	jsr	DenghaostepSix
	jsr	DenghaostepSeven
	jsr	DenghaostepEight
	jsr	DenghaostepNine
	jsr	DenghaostepTen
	jsr	DenghaostepEleven
	rts
;;======================================
;;function:将带'='号的反查的词条保存用于完全匹配
;;input:Findbuff
;;output:DengHaoBuff
;;======================================
StoreDenghaoChar:
	ldy	#0ffh
?_loop:
	iny
	cpy	#26
	bcs	?_exit
	lda	findbuff,y
	sta	DengHaoBuff,y
	bne	?_loop
?_exit:
	rts




;;=====================================
;;function:替换"空格(*)"为无
;;input:
;;output:
;;=====================================
DenghaostepOne:
?_Bigloop:
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#' '
	bne	?_loop

	iny
	lda	findbuff,y
	cmp	#'('
	bne	?_loop

	tya
	tax
?_loop1:
	iny
	lda	findbuff,y
	beq	?_0
	cmp	#')'
	bne	?_loop1
?_loop2:
	iny
	lda	findbuff,y
	sta	findbuff,x
	beq	?_Bigloop
	inx
	bra	?_loop2
?_0:
	lda	#0
	sta	findbuff,x
?_exit:
	rts

;;=====================================
;;function:替换"(*)"为无
;;input:
;;output:
;;=====================================
DenghaostepTwo:
?_Bigloop:
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'('
	bne	?_loop

	tya
	tax
?_loop1:
	iny
	lda	findbuff,y
	beq	?_0
	cmp	#')'
	bne	?_loop1
?_loop2:
	iny
	lda	findbuff,y
	sta	findbuff,x
	beq	?_Bigloop
	inx
	bra	?_loop2
?_0:
	lda	#0
	sta	findbuff,x
?_exit:
	rts

;;=====================================
;;function:替换"\*\"为'\'
;;input:
;;output:
;;=====================================
DenghaostepThree:
?_Bigloop:
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_Exit
	cmp	#'\'
	bne	?_loop
	tya
	tax
?_loop1:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'\'
	bne	?_loop1
?_loop2:
	inx
	iny
	lda	findbuff,y
	sta	findbuff,x
	beq	?_Bigloop
	bra	?_loop2
?_Exit:
	rts

;;=====================================
;;function:替换"\*空格"为'空格'
;;input:
;;output:
;;=====================================
DenghaostepFour:
?_bigloop:
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'\'
	bne	?_loop

	tya
	tax
?_loop1:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#' '
	bne	?_loop1
?_loop2:
	lda	findbuff,y
	sta	findbuff,x
	beq	?_BigLoop
	inx
	iny
	bra	?_loop2
?_exit:
	rts

;;=====================================
;;function:替换"\*"为无
;;input:
;;output:
;;=====================================
DenghaostepFive:
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'\'
	bne	?_loop
	lda	#0
	sta	findbuff,y
?_exit:
	rts

;;=====================================
;;function:替换",*'为无
;;input:
;;output:
;;=====================================
DenghaostepSix:
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#','
	bne	?_loop
	lda	#0
	sta	findbuff,y
?_exit:
	rts

;;=====================================
;;function:替换"..."为"空格"
;;input:
;;output:
;;=====================================
DenghaostepSeven:
?_bigloop:
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'.'
	bne	?_loop

	tya
	tax

	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'.'
	bne	?_loop
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#'.'
	bne	?_loop

	lda	#' '
	sta	findbuff,x
?_loop1:
	inx
	iny
	lda	findbuff,y
	sta	findbuff,x
	beq	?_bigloop
	bra	?_loop1
?_exit:
	rts

;;=====================================
;;function:转化外来字
;;input:
;;output:
;;=====================================
DenghaostepEight:
	ldy	#0ffh
?_Loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#20h
	bcs	?_0
        tax
        lda     replacetab1,x
        sta	findbuff,y
	bra	?_Loop
?_0:
        cmp     #9ah
        bcc     ?_2
        sec
        sbc     #9ah
        tax
        lda     replacetab2,x
        sta	findbuff,y
	bra	?_loop
?_2:
        cmp     #8bh
        bcc     ?_Loop
        cmp     #8eh
        bcs     ?_Loop
        sec
        sbc     #8bh
        tax
        lda     replacetab3,x
	sta	findbuff,y
        bra	?_loop
?_exit:
	rts

;;=====================================
;;function:删除所有非字母和空格的字符
;;input:
;;output:
;;=====================================
DenghaostepNine:
?_bigloop:

	ldy	#0ffh
?_loop:
	iny
	lda	findbuff,y
	beq	?_exit
	cmp	#' '
	beq	?_loop
	cmp	#'z'+1
	bcs	?_delet
	cmp	#'A'
	bcc	?_delet
	cmp	#'a'
	bcs	?_loop
	cmp	#'Z'+1
	bcc	?_loop
?_delet:
	tya
	tax
?_loop1:
	iny
	lda	findbuff,y
	sta	findbuff,x
	beq	?_bigloop
	inx
	bra	?_loop1
?_Exit:
	rts

;;=====================================
;;function:删除首空和尾空
;;input:
;;output:
;;=====================================
DenghaostepTen:
?_bigloop:
	lda	findbuff
	cmp	#' '
	bne	?_0
	ldy	#0ffh
?_loop:
	iny
	lda	findbuff+1,y
	sta	findbuff,y
	bne	?_loop
	bra	?_bigloop
?_0:
	ldy	#0ffh
?_loop1:
	iny
	lda	findbuff,y
	bne	?_loop1
?_loop2:
	dey
	lda	findbuff,y
	cmp	#' '
	bne	?_exit
	lda	#0
	sta	findbuff,y
	bra	?_loop2
?_exit:
	rts

;;=====================================

⌨️ 快捷键说明

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