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

📄 basic_fn.asm

📁 calculator code ,use toshibaor nec LSI
💻 ASM
📖 第 1 页 / 共 5 页
字号:
;V3.00		@BBS	(F_CALER,acc_subtl_9)	;V1.19if error occured?  yes->	
;V3.00		call	acc_clear	;V1.33
;V3.00		ld	hl,IC_A		;v1.33 ;V1.51
;V3.00		call	ic_update	;V1.33 ;V1.51
;V3.00		call	w1_to_acc		;V1.19
;V3.00		jp	acc_subtl_1y	;V1.33
		;-------------------------------------------------TA logic finished
acc_subtl_y:					;V1.19
acc_subtl_1:				;V1.00/
		ld	hl,IC_A
		call	ic_to_icbk		;V1.22
		ld	(SYM),S_SPC		;V1.24
		call	ic_print
acc_subtl_1y:			
		call	acc_to_w2		;V1.11
;V3.00		@BBC	(SW_TA,acc_subtl_1zz)	;V1.35a
;V3.00		call	w2_round		;v1.25a
;V3.00acc_subtl_1zz:					;V1.35a
		call	w2_to_w4	;V1.22	for average calc
		call	w2_to_ten	;V1.11
;V3.04		call	ten_to_w2dp	;V1.11
acc_subtl_3:
		ld	hl,W2
		ld	(SYM),S_ST
		call	wk_print		;W2(accumulator value) print
		call	w2_to_ten		;for display accumulator value(W2)
;V4.13		@SEB	(F_FNEABL)	;V1.09
acc_subtl_9:				;V1.19
		j	function_end
		
;===============================================================================
;		T
;===============================================================================
acc_total:
;V4.01		cmp	(PRE_KEY),K_M2CAL	;V1.22
;V4.01		j	ne,acc_total_start	;V1.22
;V4.01		ld	(KEYIN),K_M2TL		;V1.22
;V4.01		jp	mem2_total		;V1.22
acc_total_start:				;V1.22
;V4.01		@CLB	(F_EQU)			;V1.24
			;------------------------below is for TA logic
;V3.00		@BBC	(SW_TA,acc_total_0)	;V1.19
;V3.00		ld	a,(FLG_E)		;V1.19
;V3.00		and	a,0y00001111		;V1.19check E_MUL,E_DIV flags
;V3.00		j	nz,acc_total00		;V1.19
;V3.00		@BBS	(F_PEREXE,acc_total_0)	;V1.24
;V3.00		ld	a,(FLG_C)		;V1.19
;V3.00		and	a,0y00000011	;V1.39d
;V3.00		j	nz,acc_total00		;V1.39d
;V3.00		ld	a,(FLG_C)		;V1.39d\
;V3.00		and	a,0y00001100		;V1.39d|
;V3.00		j	z,acc_total_0		;V1.39d|for MU and DLT compute continually
;V3.00		ld	(FLG_E),a		;V1.24 /
;V3.00acc_total00:					;V1.19
;V3.00		@SEB	(F_EQU)			;V1.24 total perform [equal] function
;V3.00		@BBC	(E_MUP,acc_total101)	;V1.24
;V3.00		call	equal_mup		;V1.24
;V3.00		jp	acc_total199		;V1.24
;V3.00acc_total101:					;V1.24
;V3.00		@BBC	(E_DLT,acc_total102)	;V1.24
;V3.00		call	equal_dlt		;V1.24
;V3.00		jp	acc_total199		;V1.24
;V3.00acc_total102:					;v1.24
;V3.00		call	equal_sub		;V1.19
;V3.00acc_total199:
;V3.00		ld	(KEYIN),K_EQU		;V1.50
;V3.00		@BBS	(F_CALER,acc_total9)	;V1.19if error occured?  yes->
;V3.00		ld	hl,W1			;V1.33\
;V3.00		call	wk_round		;V1.33|
;V3.00		ld	(SYM),S_TL		;V1.33|
;V3.00		call	wk_print		;V1.33|for equ print
;V3.00		call	feed_1		;V1.34
;V3.00		call	w1_to_ten	;V1.34 for display
;V3.00		call	acc_clear	;V1.43
;V3.00		jp	acc_total9		;V1.33/
			;-------------------------------------TA logic finished
acc_total_0:	;---------------Victor 1297 mode
		ld	hl,IC_A			;
		call	ic_to_icbk		;V1.22
		ld	(SYM),S_SPC		;V1.24
		call	ic_print		;
		call	acc_to_w2		;
		call	w2_to_w4		;V1.22	for average calc
		call	acc_clear		;
		ld	hl,W2			;
		call	wk_round		;W2(accumulator value) rounding
		ld	(SYM),S_TL
;V4.01		@BBC	(SW_GT,acc_total0)	;GT sw is on?  no ->
;V4.01		@BBS	(F_EQU,acc_total0)	;V1.24
;V4.01		ld	(SYM),S_STAPL		;V1.24
;V4.01acc_total_01:					;V1.24
;V4.01		ld	hl,W2
;V4.01		call	wk_print		;W2 print
;V4.01		ld	hl,MEMGT
;V4.01		call	wk_update		;w2 contents add to ACC and increment item counter
;V4.01		@BBS	(F_CALER,acc_total9)	;V1.27if error occured?  yes->
;V4.01		@CLB	(ICON_GT)	;V1.27
;V4.01		ld	hl,MEMGT	;V1.18
;V4.01		call	_zerock		;V1.24
;V4.01		j	z,acc_total_y	;V1.18
;V4.01		@SEB	(ICON_GT)	;V1.18
;V4.01acc_total_y:				;V1.18
;V4.01		ld	hl,IC_G
;V4.01		call	ic_update		;increment item counter
;V4.01		j	acc_total8
;V4.01acc_total0:
		ld	hl,W2			;V1.25
		call	edit_prn		;V4.03
	ld	wa,M_5514T
	test	(M_5514T>>4).a		;bit -reverse-> jump status
	j	t,acc_total0		;if jump status is 1 -> branch
	ld	wa,F_ENLARG
	set	(F_ENLARG>>4).a
acc_total0:					;V4.03
		call	wk_print9		;V4.03
;V4.03		call	wk_print		;W2 print

acc_total8:
		call	feed_1			;1 line feed
		call	w2_to_ten		;for display accumulator value(W2)
;V4.13		@SEB	(F_FNEABL)	;V1.09
;V4.01		@BBC	(SW_MGT,acc_total9)	;V1.17
;V4.01		ld	hl,MEM1			;V1.17
;V4.01		call	wk_update		;V1.17w2 contents add to MEM1
;V4.01		@BBS	(F_CALER,acc_total9)	;V1.27if error occured?  yes->
;V4.01		ld	hl,IC_M			;V1.17
;V4.01		call	ic_update		;V1.17increment item counter
;V4.01		@SEB	(ICON_M)		;V1.22set 'M'
;V4.01		call	w1_zerock		;V1.22check updated MEM1 content
;V4.01		j	nz,acc_total9		;V1.22
;V4.01		@CLB	(ICON_M)		;V1.22clear 'M'
acc_total9:
		ld	(SYM),S_AST		;for error print
		j	function_end

;===============================================================================
;		%
;===============================================================================
percent_key:
	ld	wa,F_PEREXE
	set	(F_PEREXE>>4).a
;		@CLB	(F_RATE)	;V1.09
		ld	a,(FLG_E)
		and	a,0y00000011		;E_MUL,E_DIV,only
		j	nz,equal_key2
		ld	a,(FLG_C)
		and	a,0y00000011		;C_MUL,C_DIV,only
		j	nz,equal_key2
	ld	wa,F_PEREXE
	clr	(F_PEREXE>>4).a
;V3.05		ld	a,(FLG_E)	;V1.11\for E_MU,E_DLT
;V3.05		and	a,0y00001100	;v1.11|
;V3.05		j	nz,equal_key0	;V1.11|
;V3.05		ld	a,(FLG_C)	;V1.11|for C_MU,C_DLT
;V3.05		and	a,0y00001100	;V1.11|
;V3.05		j	nz,equal_key0	;V1.11/
		j	no_operation		;if no calculate instruction  yes-> exit

;V1.36percent_key_1:			;V1.35b
;V1.36		j	function_end	;V1.35
;===============================================================================
;		%+
;===============================================================================
perplus_key:
	ld	wa,F_RATE
	test	(F_RATE>>4).a		;bit -reverse-> jump status
	j	t,perplus_calc		;if jump status is 1 -> branch
	ld	wa,F_TNKEY
	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
	j	t,perplus_rate_recall		;if jump status is 1 -> branch
		call	keep_ten_6dig
		call	ten_to_w2
		call	w2_to_tax2
		call	w2_to_eetx2
		jp	perplus_key_1
perplus_rate_recall:
		call	tax2_to_w2
		call	w2_to_ten
		call	keep_ten_6dig
		call	ten_to_w2
perplus_key_1:
		ld	(SYM),0x39
		call	w2_print
		call	feed_1
		call	ten_clear
	ld	wa,RATE_PROG
	clr	(RATE_PROG>>4).a
	ld	wa,EURO_PROG
	clr	(EURO_PROG>>4).a
	ld	wa,F_COUNTRY
	clr	(F_COUNTRY>>4).a
	ld	wa,F_RATE
	clr	(F_RATE>>4).a
	ld	wa,F_TNKEY
	clr	(F_TNKEY>>4).a
	ld	wa,F_DPIN
	clr	(F_DPIN>>4).a
	ld	wa,EURO_DISPLY
	set	(EURO_DISPLY>>4).a
		ld	(TEN_CT),0	;
		ld	(DT_CT),0	;
		ld	(DT_DOT_CNT),0	;
		ld	(DT_CHR_CNT),0	;
		ld	a,(FLG_C)	
		and	a,0y00000000	
		ld	(FLG_C),a	
		ld	a,(FLG_E)		;clear all calculate instruction flags except E_MUP,E_MUL,E_DIV
		and	a,0y00001111		
		ld	(FLG_E),a
		call	spc_disp
		ld	hl,W2
		call	edit_disp
		ld	(DISP+5),D_P
		ld	(DISP+6),D_EQU
		call	disp_to_dbr
		ld	(KEYIN),K_EURO_LOCAL_TAX_DUM
		ld	(PRE_KEY),K_EURO_LOCAL_TAX_DUM
		jp	no_operation		
perplus_calc:
		call	acc_to_w2
		ld	(SYM),S_ST
		call	w2_print
	ld	wa,F_TNKEY
	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
	j	f,perplus_calc_1		;if jump status is 0 -> branch
		call	tax2_to_w1
		call	w1_to_ten
		call	keep_ten_6dig
		call	ten_to_w1
		ld	(SYM),0x39
		jp	perplus_calc_2
perplus_calc_1:
		call	ten_to_w1
		ld	(SYM),S_PER
perplus_calc_2:
		call	w1_print
	ld	wa,F_PERCAL
	set	(F_PERCAL>>4).a
		call	calc_mult
		ld	(SYM),S_PLS
		call	w1_round_print
perplus_calc_end:
		call	w2_to_w4
		call	exchg_w12
		ld	hl,ACC
		call	wk_update		;w2 contents add to ACC and increment item counter
	ld	wa,F_CALER
	test	(F_CALER>>4).a		;bit -reverse-> jump status
	j	f,perplus_calc_end9		;if jump status is 0 -> branch
		ld	hl,IC_A
		call	ic_update		;increment item counter
		ld	hl,IC_A			;
		call	ic_to_icbk		;
		ld	(SYM),S_SPC		;
		call	ic_print		;
		call	w4_to_w1
		call	calc_add
		ld	(SYM),S_ST
		call	w1_round_print
		call	w1_to_acc
		call	w1_to_ten
		call	feed_1
perplus_calc_end9:
		ld	(SYM),S_AST
		ld	(FLG_E),0	;V3.05
		ld	(FLG_C),0	;V3.05
		jp	function_end
;===============================================================================
;		=
;===============================================================================
equal_key:
	ld	wa,F_REVCAN
	set	(F_REVCAN>>4).a
	ld	wa,F_RATE
	test	(F_RATE>>4).a		;bit -reverse-> jump status
	j	t,equal_start		;if jump status is 1 -> branch
;V4.12a		ld	a,(KEYIN)	;V4.12
;V4.12a		ld	(PRE_KEY),a	;V4.12
;V4.12		@BBS	(F_COUNTRY,equal_obs_rate_recall0)
;V4.12		@BBS	(F_COUNTRY,rate_ten_key_01)	;V4.12
	ld	wa,EURO_PROG
	test	(EURO_PROG>>4).a		;bit -reverse-> jump status
	j	f,print_present_rate		;if jump status is 0 -> branch
	ld	wa,F_TNKEY
	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
	j	f,rate_ten_key_01		;if jump status is 0 -> branch
equal_obs_rate_recall0:
;V4.12		@BBC	(M_5514T,equal_obs_rate_3212)	;V4.12
;V4.12		@BBS	(F_COUNTRY,rate_ten_key_01)	;V4.12
;V4.12equal_obs_rate_3212:					;v4.12
		ld	(SYM),S_TAX
		ld	hl,TAXRT
		call	wk_print
		ld	(SYM),0x39
		ld	hl,TAX2RT
		call	wk_print
		ld	(COUNTRY_TEN),0
equal_obs_rate_recall:
		cmp	(COUNTRY_TEN),12
		j	ge,altervable_euro_to_ten
		call	fix_euro_to_ten
		jp	altervable_euro_to_ten_end
altervable_euro_to_ten:
		ld	a,(COUNTRY_TEN)
		clr	cf
		sub	a,12
		call	ee_to_ten
		call	keep_ten_6dig
altervable_euro_to_ten_end:
		ld	hl,TENKEY
		call	euro_print

		ld	a,(COUNTRY1)
		cmp	a,(COUNTRY2)
		j	ne,altervable_euro_to_ten_end_1
		cmp	a,(COUNTRY_TEN)
		j	ne,altervable_euro_to_ten_end_1
	ld	wa,F_COUNTRY_EQU
	test	(F_COUNTRY_EQU>>4).a		;bit -reverse-> jump status
	j	f,altervable_euro_to_ten_end_1		;if jump status is 0 -> branch
	ld	wa,F_COUNTRY2
	set	(F_COUNTRY2>>4).a
	ld	wa,F_COUNTRY_EQU
	set	(F_COUNTRY_EQU>>4).a
		dec	(COUNTRY_TEN)
altervable_euro_to_ten_end_1:
		inc	(COUNTRY_TEN)
		cmp	(COUNTRY_TEN),17
		j	lt,equal_obs_rate_recall
equal_obs_rate_recall_end:
		call	feed_1
		call	ten_clear
	ld	wa,F_COUNTRY_EQU
	clr	(F_COUNTRY_EQU>>4).a
	ld	wa,M_5514T
	test	(M_5514T>>4).a		;bit -reverse-> jump status
	j	t,function_end		;if jump status is 1 -> branch
	ld	wa,F_COUNTRY
	clr	(F_COUNTRY>>4).a
		jp	function_end
		;---------------------------------------
print_present_rate:
		call	keep_ten_6dig
		call	euro_display
		ld	a,(COUNTRY_TEN)		;V4.10
		cmp	a,(COUNTRY1)		;v4.10
;V4.17		j	eq,print_present_rate1	;v4.10
		j	ne,print_present_rate1	;V4.17
		call	ten_to_euro1
print_present_rate1:
		ld	a,(COUNTRY_TEN)		;V4.17
		cmp	a,(COUNTRY2)		;V4.10
		j	ne,print_present_rate2	;V4.10
		call	ten_to_euro2		;V4.10
;V4.17		j	print_present_rate2	;V4.10
;V4.17print_present_rate1:				;V4.10
;V4.17		call	ten_to_euro1		;V4.10
print_present_rate2:				;v4.10
		ld	hl,TENKEY
		call	euro_print
		call	euro_set_sub
		call	feed_1
		call	ten_clear
	ld	wa,F_RATE
	clr	(F_RATE>>4).a
	ld	wa,RATE_PROG
	clr	(RATE_PROG>>4).a
	ld	wa,EURO_PROG
	clr	(EURO_PROG>>4).a
	ld	wa,F_TNKEY
	clr	(F_TNKEY>>4).a
	ld	wa,F_DPIN
	clr	(F_DPIN>>4).a
		ld	(TEN_CT),0	;
		ld	(DT_CT),0	;
		ld	(DT_DOT_CNT),0	;
		ld	(DT_CHR_CNT),0	;
		ld	(KEYIN),K_EURO_LOCAL_TAX_DUM
		ld	(PRE_KEY),K_EURO_LOCAL_TAX_DUM
		jp	no_operation
		;-----------------------------------------------------------

;V3.00		@BBC	(M_VIC,equal_start)	;V2.10
;V3.00		@BBC	(E_DIV,equal_start)	;V1.34
;V3.00		cmp	(PRE_KEY),K_DIV	;V1.34
;V3.00		j	ne,equal_start	;V1.34
;V3.00		ld	(KEYIN),K_ROOT		;V1.34
;V3.00		jp	square_root		;V1.34
equal_start:					;V1.34
	ld	wa,F_PEREXE
	test	(F_PEREXE>>4).a		;bit -reverse-> jump status
	j	f,no_operation		;if jump status is 0 -> branch
		ld	a,(FLG_E)
		and	a,0y00001111		;E_MUL,E_DIV,E_DLT,E_MUP only
		j	nz,equal_key0
		ld	a,(FLG_C)
		and	a,0y00001111		;C_MUL,C_DIV,C_DLT,C_MUP only
		j	z,no_operation		;if no calculate instruction  yes-> exit
equal_key0:
	ld	wa,E_MUP
	test	(E_MUP>>4).a		;bit -reverse-> jump status
	j	f,equal_mup		;if jump status is 0 -> branch
	ld	wa,C_MUP
	test	(C_MUP>>4).a		;bit -reverse-> jump status
	j	f,equal_mup		;if jump status is 0 -> branch

	ld	wa,E_DLT
	test	(E_DLT>>4).a		;bit -reverse-> jump status
	j	f,equal_dlt		;if jump status is 0 -> branch
	ld	wa,C_DLT
	test	(C_DLT>>4).a		;bit -reverse-> jump status
	j	f,equal_dlt		;if jump status is 0 -> branch
equal_key2:
		call	equal_sub

⌨️ 快捷键说明

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