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

📄 basic_fn.mac

📁 calculator code ,use toshibaor nec LSI
💻 MAC
📖 第 1 页 / 共 5 页
字号:
;V4.01		@BBS	(F_CALER,acc_plus29)	;V1.17if error occured?  yes->
;V4.01		@SEB	(FEED_REQ)		;V1.27
;V4.01		call	w1_to_w2		;V1.17
;V4.01		call	w2_to_ten		;V1.17
acc_plus01:					;V1.17
		@BBS	(F_TNKEY,acc_plus02)	;V1.31
;check %+/- operation........
		cmp	(PRE_KEY),K_PER		;if previouse key is % ?
		j	ne,acc_plus00		;no ->
		@BBS	(C_MUL,acc_plus20)	; after multiply %?  yes -> %+/- function
acc_plus00:

;if no tenkey entry, check repeat entry........
		cmp	(PRE_KEY),K_PLS		;if previouse key is + ?
		j	eq,acc_plus10		; yes -> use W2(previouse added value) for repeat entry
		cmp	(PRE_KEY),K_MIN		;if previouse key is - ?
		j	eq,acc_plus10		; yes -> use W2(previouse added value) for repeat entry
acc_plus02:
;V1.05		call	ten_to_w2dp		;tenkey -> W2 with DP adjustment
		call	add_mode		;W2 shift 2digit to right when select ADD mode
		j	cs,acc_plus03		;V105 add mode ?  yes->
		call	ten_to_w2dp		;V105 tenkey -> W2 with DP adjustment
;V3.14		call	ten_to_w2	;V3.12
acc_plus03:					;V105
		j	acc_plus11

acc_plus10:
		ld	hl,W2			;DP adjustment for repeat entry
		call	dp_adjust		;adjustment DP location previouse accumulated value(in case of change DP slider)
acc_plus11:
		ld	(SYM),S_PLS
		@BBC	(F_MIN_TRA,acc_plus12)
		ld	(SYM),S_MIN
acc_plus12:
		ld	hl,W2
		call	wk_print		;W2(input value) print
		ld	hl,ACC
		call	wk_update		;w2 contents add to ACC and increment item counter
		@BBS	(F_CALER,acc_plus29)	;V1.27if error occured?  yes->
		ld	hl,IC_A
		call	ic_update		;increment item counter
		ld	hl,W1			;V3.05
		call	_zerock			;V3.05
		j	ne,acc_plus13		;V3.05
		ld	(W1_S),0		;V3.05
acc_plus13:					;V3.05	
		call	w1_to_ten		;for display accumulated value(W1)
		@BBC	(FEED_REQ,acc_plus29)	;V1.27
		call	feed_1			;V1.27
		@CLB	(FEED_REQ)		;V1.27
		j	acc_plus29

;percent +/- calculation........................
acc_plus20:
		call	const_to_w2		;W2 <- multiplicand
		call	ten_to_w1
		@BBC	(F_MIN_TRA,acc_plus21)
		xor	(W1_S),0x01		;W1 sign change
acc_plus21:
		call	calc_add		;W1<- W1(calculated answer of %) + W2
		@BBS	(F_CALER,acc_plus29)	;if error occured?  yes->
		ld	hl,W1
		call	wk_round		;W1(answer) rounding
		ld	(SYM),S_PRAD
		ld	(KEYIN),K_PRP		;update current key code to +%(dummy key code)
		@BBC	(F_MIN_TRA,acc_plus213)
		ld	(SYM),S_PRDS
		ld	(KEYIN),K_PRM		;update current key code to -%(dummy key code)
acc_plus213:
		@IS_5514_ON(acc_plus22)	;V4.12
		call	_zerock			;V1.35
		j	ne,acc_plus22		;V1.35
		ld	(W1_S),0		;V1.35
acc_plus22:
		@CLB	(F_MIN_TRA)
		call	wk_print		;W1(answer) print
		call	feed_1
		call	w1_to_ten		;for display calculated answer(W1)
acc_plus29:
		ld	(SYM),S_AST		;for error print
;V4.13		@BBC	(SW_TA,acc_plus99)	;V1.39d
;V4.13		ld	(FLG_C),0		;V1.39d
acc_plus99:					;V1.39d
		j	function_end


;===============================================================================
;		S
;===============================================================================
acc_subtl:
;V4.01		cmp	(PRE_KEY),K_M2CAL	;V1.22
;V4.01		j	ne,acc_subtl_start	;V1.22
;V4.01		ld	(KEYIN),K_M2ST		;V1.22
;V4.01		jp	mem2_subtl_start	;V1.22
acc_subtl_start:				;V1.22
;V3.00		@BBC	(SW_V15,acc_subtl_nov1297)	;V2.05
;V3.00		@BBC	(SW_TA,acc_subtl_nov1297)	;V2.05
;V3.00acc_subtl_start1:
		;---------------------------------------------for V1297 mode
;V3.00		@BBC	(F_TNKEY,acc_subtl_yuan)	;V1.26
;V3.00		ld	(KEYIN),K_SHD			;V1.26
;V3.00		jp	sharp_date			;V1.26
acc_subtl_yuan:						;V1.25
;V3.00		ld	a,(FLG_E)			;V1.25
;V3.00		push	wa
;V3.00		@BBC	(SW_SGK,acc_subtl_nocont)	;V1.26
;V3.00		pop	wa
;V3.00		or	a,(FLG_C)			;V1.26
;V3.00		jp	acc_subtl_nocont_1		;V1.26
;V3.00acc_subtl_nocont:					;V1.26
;V3.00		pop	wa				;V1.26
;V3.00acc_subtl_nocont_1:					;V1.26
;V3.00		and	a,0y00001111			;V1.26
;V3.00		j	eq,acc_subtl_clear		;V1.25
;V3.00		call	const_to_w2			;V1.26
;V3.00		jp	acc_subtl_clear_1		;V1.26
;V3.00acc_subtl_clear:					;V1.26
;V3.00		call	w2_clear			;V1.26
;V3.00acc_subtl_clear_1:					;V1.26
;V3.00		call	w2_to_ten			;V1.26
;V3.00		ld	(SYM),S_ST			;V1.26
;V3.00		ld	hl,W2				;V1.26
;V3.00		call	wk_print			;V1.26
;V3.00		call	feed_1				;V1.25
;V3.00		@BBS	(SW_SGK,acc_subtl_9)		;V1.31
;V3.00		and	(FLG_C),0	;V1.40
;V3.00		jp	acc_subtl_9			;V1.25
		;----------------------------------------------------
acc_subtl_nov1297:

;V4.13		@BBC	(SW_DTST,acc_subtl_x)	;V1.20
;V4.13		@BBC	(F_TNKEY,acc_subtl_x)	;V1.33
;V2.10		ld	a,(TEN_CT)	;V1.20\
;V2.10		j	eq,acc_subtl_x	;V1.20|ten key entry, to do sharp date function
;V4.13		ld	(KEYIN),K_SHD	;V1.20|
;V4.13		jp	sharp_date	;V1.20/	
acc_subtl_x:					;V1.20
		;-----------------------------------------------below is for TA logic
;V3.00		@BBC	(SW_TA,acc_subtl_y)	;V1.19
;V3.00		ld	(FLG_C),0	;V1.44
;V3.00		ld	a,(FLG_E)		;V1.19
;V3.00		and	a,0y00001111		;V1.19check E_MUL,E_DIV,E_DLT,E_MU flags
;V3.00		j	z,acc_subtl_y		;V1.19
;V3.00		@BBC	(E_MUP,acc_subtl_x01)	;V1.24
;V3.00		call	equal_mup		;V1.24
;V3.00		jp	acc_subtl_x99		;V1.24
;V3.00acc_subtl_x01:					;V1.24
;V3.00		@BBC	(E_DLT,acc_subtl_x02)	;V1.24
;V3.00		call	equal_dlt		;V1.24
;V3.00		jp	acc_subtl_x99		;V1.24
;V3.00acc_subtl_x02:					;v1.24
;V3.00		call	equal_sub		;V1.19
;V3.00acc_subtl_x99:
;V3.00		ld	(FLG_E),0	;V1.24
;V3.00		ld	(KEYIN),K_EQU	;V1.50
;V3.00		ld	(FLG_C),0	;V1.24
;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
		@BBC	(M_5514T,acc_total0)
		@SEB	(F_ENLARG)		;V4.03 indicate to enlarge fond for next print
acc_total0:					;V4.03
		call	wk_print9		;V4.03
;V4.03		call	wk_print		;W2 print
;;V4.01		@CLB	(F_EQU)		;V1.24
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:
		@SEB	(F_PEREXE)	;V1.25
;		@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
		@CLB	(F_PEREXE)		;V1.25
;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:
		@BBC	(F_RATE,perplus_calc)
		@BBC	(F_TNKEY,perplus_rate_recall)
		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
		@CLB	(RATE_PROG)
		@CLB	(EURO_PROG)
		@CLB	(F_COUNTRY)	;V4.17
		@CLB	(F_RATE)
		@CLB	(F_TNKEY)
		@CLB	(F_DPIN)
		@SEB	(EURO_DISPLY)
		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
		@BBS	(F_TNKEY,perplus_calc_1)
		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
		@SEB	(F_PERCAL)
		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
		@BBS	(F_CALER,perplus_calc_end9)	;if error occured?  yes->
		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:
		@SEB	(F_REVCAN)	;V4.12
		@BBC	(F_RATE,equal_start)
;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
		@BBS	(EURO_PROG,print_present_rate)
		@BBS	(F_TNKEY,rate_ten_key_01)
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

⌨️ 快捷键说明

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