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

📄 basic_fn.mac

📁 calculator code ,use toshibaor nec LSI
💻 MAC
📖 第 1 页 / 共 5 页
字号:
sharp_date:
		@BBS	(F_RATE,sharp_date_obs)
;V4.13		@SEB	(F_FNEABL)	;V1.10
		ld	a,(DT_CT)		;#/D number entry counter
		j	nz,sharp_dt0		;with tenkey entry?  yes->
		@BBS	(F_TNKEY,sharp_dt0)	;V1.24
		@BBS	(F_DPIN,sharp_dt0)	;V1.14
;		cmp	(PRE_KEY),K_SHD		;if previouse key is #/D ?
;		j	eq,sharp_dt0		;if repeat entry?  yes->
;V1.29		call	acc_to_ten	;V1.29
		clr	cf			;CF=0: in case of no tenkey
		j	sharp_dt2
sharp_dt0:
		set	cf			;CF=1: in case of repeat or with tenkey
sharp_dt2:
		call	print_shpd		;print DT_BUF by #/D format

		ld	(TEN_CT),0		;tenkey counter
		ld	(DT_CT),0		;#/D entry counter
		ld	(DT_DOT_CNT),0	;V1.06
		ld	(DT_CHR_CNT),0	;V1.06
		@CLB	(F_DPIN)		;DP entry status flag
		ld	a,(PRE_KEY)
		@IS_5514_ON(sharp_dt3)	;V4.17
		cmp	a,K_PLS			;+ key?
		j	eq,sharp_dt9		; yes -> doesn't update PRE_KEY for continue repeat
		cmp	a,K_MIN			;- key?
		j	eq,sharp_dt9
sharp_dt3:
		cmp	a,K_ST		;V1.52
		j	eq,sharp_dt9	;V1.52
		cmp	a,K_TL		;V1.52
		j	eq,sharp_dt9	;V1.52

		cmp	a,K_MUL			;Multiple key?
		j	eq,sharp_dt9
		cmp	a,K_DIV			;Divide key?
		j	eq,sharp_dt9
		cmp	a,K_PER			;percent key?
		j	eq,sharp_dt9
		;V1.52----------------------------
		cmp	a,K_MPL
		j	eq,sharp_dt9
		cmp	a,K_MMI
		j	eq,sharp_dt9
		cmp	a,K_MST
		j	eq,sharp_dt9
		cmp	a,K_MTL
		j	eq,sharp_dt9

;V4.01		cmp	a,K_M2PL
;V4.01		j	eq,sharp_dt9
;V4.01		cmp	a,K_M2MI
;V4.01		j	eq,sharp_dt9
;V4.01		cmp	a,K_M2ST
;V4.01		j	eq,sharp_dt9
;V4.01		cmp	a,K_M2TL
;V4.01		j	eq,sharp_dt9
		;V1.52--------------------------------
		ld	a,(KEYIN)
		ld	(PRE_KEY),a		;save current key code -> PRE_KEY
sharp_dt9:
		@CLB	(F_RATE)		;V1.11
		@CLB	(RATE_PROG)		;V1.11
		@CLB	(EURO_PROG)		;V1.11
		@BBS	(EURO_DISPLY,no_operation)	;V3.04
		j	shp_sgn_end		;exit of # key and +/- key
;===============================================================================
mem2_minus:
;V4.13		jp	mem2_plus	;V1.18
;===============================================================================
;		M-
;===============================================================================
mem_minus:
;V3.00		@BBS	(M_FINANCE,key_month);finance calculation
;V1.36		@SEB	(F_MIN_TRA)	;V1.27
		jp	mem_plus	;V1.18
;===============================================================================
;		M+
;===============================================================================
mem2_plus:
;V4.13		@SEB	(M_M2)		;V1.18
;V4.13		jp	mem_plus_y0	;V1.20
;===============================================================================
mem_plus:
;		cmp	(PRE_KEY),K_M2CAL	;V1.22
;		j	ne,mem_plus_start	;V1.22
;		ld	(KEYIN),K_M2PL		;V1.22
;		jp	mem2_plus		;V1.22
;mem_plus_start:					;V1.22
;V3.00		@BBS	(M_FINANCE,key_payment)	;finance calculation
mem_plus_y0:
		@BBC	(MEQ_ENB,mem_plus00)	;if just error occur?  yes ->not allow mutiple/divide calculation before M+/M-
;V4.01		@BBC	(M_M2,mem_plus_y1)	;V1.19
;V4.01		@BBS	(SW_SGG,mem_plus_y2)	;V1.19
;V4.01		jp	mem_plus00		;V1.19
;V4.01mem_plus_y1:					;V1.18
		@BBC	(SW_SGM,mem_plus00)	;V1.17 [M+]/[M-] have function for [M+=]/[M-=]? 
mem_plus_y2:					;V1.19
		ld	a,(FLG_E)		;V1.19
		and	a,0y00000011		;V1.19check E_MUL,E_DIV flags
		j	nz,mem_plus_y21		;V1.19
;V4.11		@BBC	(SW_SGK,mem_plus00)	;V1.19
;V4.11		@BBS	(F_PEREXE,mem_plus00)	;V1.24
;V4.11		@BBC	(F_TNKEY,mem_plus_y21)	;V1.24
;V4.11		ld	a,(FLG_C)		;V1.19
;V4.11		and	a,0y00000011		;V1.19
		j	z,mem_plus00		;V1.19
mem_plus_y21:
;V4.11		@BBC	(E_MUP,mem_plus_y2101)	;V1.24
;V4.11		call	equal_mup		;V1.24
;V4.11		jp	mem_plus_y2199		;V1.24
mem_plus_y2101:					;V1.24
;V4.11		@BBC	(E_DLT,mem_plus_y2102)	;V1.24
;V4.11		call	equal_dlt		;V1.24
;V4.11		jp	mem_plus_y2199		;V1.24
mem_plus_y2102:					;v1.24
		call	equal_sub		;V1.17
mem_plus_y2199:
		@BBS	(F_CALER,mem_plus19)	;if error occured?  yes->
		call	w1_to_w2
		ld	(SYM),S_MPL
		cmp	(KEYIN),K_MMI		;M- key?
;V4.01		@IS_M2				;V1.19
;V4.01		j	t,mem_plus_y3		;V1.19
;V4.01		cmp	(KEYIN),K_M2MI		;V1.19
;V4.01mem_plus_y3:					;V1.19
		j	ne,mem_plus0x		; no ->
		ld	(SYM),S_MMI
		@SEB	(F_MIN_TRA)
mem_plus0x:
		ld	hl,W2
		call	wk_round		;W2(calculated answer) rounding
		call	wk_print		;W2(calculated answer) print
		call	feed_1			;feed 1 line after M=+/M=- function
		j	mem_plus12
;for M+/M---------------------------------------------------------------------------
mem_plus00:
;V105		call	ten_to_w2dp		;tenkey -> W2 with DP adjustment
		call	add_mode		;W2 shift 2digit to right when select ADD mode
		j	cs,mem_plus01		;V105 add mode ?  yes->
		call	ten_to_w2dp		;V105 tenkey -> W2 with DP adjustment
;V3.14		call	ten_to_w2	;V3.12
mem_plus01:					;V105
		ld	(SYM),S_MPL
		cmp	(KEYIN),K_MMI		;M- key?
;V4.01		@IS_M2
;V4.01		j	t,mem_plus010		;v1.19
;V4.01		ld	(SYM),S_M2PL		;V2.13
;V4.01		@BBS	(SW_EUROS,mem_plus01_eu)	;V2.15
;V4.01		ld	(SYM),S_STAPL			;V2.15
mem_plus01_eu:						;V2.15
;V4.01		cmp	(KEYIN),K_M2MI		;V1.19
mem_plus010:					;V1.19
		j	ne,mem_plus10		; no ->
		ld	(SYM),S_MMI
		@SEB	(F_MIN_TRA)
;V4.01		@IS_M2				;V2.13
;V4.01		j	t,mem_plus10		;V2.13
;V4.01		ld	(SYM),S_M2MI		;V2.13
;V4.01		@BBS	(SW_EUROS,mem_plus10)		;V2.15
;V4.01		ld	(SYM),S_STAMN			;V2.15
mem_plus10:
		ld	hl,W2
		call	wk_print		;W2(input value) print
mem_plus12:
;V4.01		@IS_M2				;V1.19
;V4.01		j	f,mem_plus13		;V1.19
		ld	hl,MEM1
		call	wk_update		;w2 contents add to MEM1
		@BBS	(F_CALER,mem_plus19)	;if error occured?  yes->
		ld	hl,IC_M
		call	ic_update		;increment item counter
		call	w2_to_ten		;for display input value(W2)
		@SEB	(ICON_M)		;set 'M'
		call	w1_zerock		;check updated MEM1 content
		j	nz,mem_plus19
		@CLB	(ICON_M)		;clear 'M'
		jp	mem_plus19
mem_plus13:
;V4.01		ld	hl,MEMGT		;V1.19
;V4.01		call	wk_update		;V1.19	;w2 contents add to MEM2
;V4.01		@BBS	(F_CALER,mem_plus19)	;V1.27if error occured?  yes->
;V4.01		ld	hl,IC_G			;V1.19
;V4.01		call	ic_update		;V1.19	;increment item counter
;V4.01		call	w2_to_ten		;V1.19	;for display input value(W2)
;V4.01		@SEB	(ICON_GT)		;V1.19	;set 'GT'
;V4.01		call	w1_zerock		;V1.19	;check updated MEM1 content
;V4.01		j	nz,mem_plus19		;V1.19
;V4.01		@CLB	(ICON_GT)		;V1.19	;clear 'M'
mem_plus19:
		ld	(SYM),S_AST		;for error print
;V4.13		@CLB	(M_M2)			;V1.19
		j	function_end
;==============================================================================
mem2_subtl:
;V4.01		@BBS	(SW_M2,mem2_subtl_start)	;V1.22
;V4.01		ld	(KEYIN),K_M2CAL			;V1.22
		jp	function_end			;V1.22
;V4.01mem2_subtl_start:
;V4.01		@SEB	(M_M2)		;V1.19
;V4.01		jp	mem_subtl_0	;V1.19
;===============================================================================
;		MS
;===============================================================================
mem_subtl:
;V3.00		@BBS	(M_FINANCE,key_interest)
mem_subtl_0:					;V1.19
;V4.01		@IS_M2			;V1.19
;V4.01		j	t,mem_subtl_2	;V1.19
;V4.01		ld	hl,IC_G		;V1.19
;V4.01		call	ic_to_icbk	;V1.22
mem_subtl_10x:						;V2.15
;V4.01		ld	(SYM),S_ICM			;V2.15
;V4.01		call	ic_print	;V1.19
;V4.01		call	gt_to_w2	;V1.19
;V4.01		call	w2_to_w4	;V1.22	for average calc
;V4.01		jp	mem_subtl_3	;V1.19
mem_subtl_2:				;V1.19
		ld	hl,IC_M
		call	ic_to_icbk	;V1.23
		ld	(SYM),S_ICM		;V1.26
		call	ic_print
		call	mem1_to_w2
		call	w2_to_w4	;V1.22	for average calc
mem_subtl_3:				;V1.19
		call	w2_to_ten	;V1.11
		call	ten_to_w2dp	;V1.11
		ld	hl,W2
		ld	(SYM),S_MST
;V4.01		@IS_M2			;V2.13
;V4.01		j	t,mem_subtl_4	;V2.13
;V4.01		ld	(SYM),S_M2ST	;V2.13
;V4.01		@BBS	(SW_EUROS,mem_subtl_4)		;V2.15
;V4.01		ld	(SYM),S_STAS			;V2.15
mem_subtl_4:
		call	wk_print	;W2(MEM1 value) print
		call	w2_to_ten	;for display MEM1 value(W2)
;V4.13		@SEB	(F_FNEABL)	;V1.09
;v4.13		@CLB	(M_M2)		;V2.15
		j	function_end
;===============================================================================
mem2_total:
;V4.13		@SEB	(M_M2)		;V1.19
;V4.13		jp	mem_total_yy	;V1.19
;===============================================================================
;		MT
;===============================================================================
mem_total:
mem_total_y:		
;V3.00		@BBS	(M_FINANCE,key_amount)	;V1.16
mem_total_yy:					;V1.21
;V4.01		@IS_M2			;V1.19
;V4.01		j	t,mem_total_y1	;V1.19
;V4.01		ld	hl,IC_G		;V1.19
;V4.01		call	ic_to_icbk	;V1.22
;V4.01		ld	(SYM),S_ICM		;V1.26
mem_totalyy_1:					;V1.26
;V4.01		call	ic_print	;V1.19
;V4.01		call	gt_to_w2	;V1.19
;V4.01		call	w2_to_w4	;V1.22	for average calc
;V4.01		call	gt_clear	;V1.19
;V4.01		@CLB	(ICON_GT)	;V1.19
;V2.15		@CLB	(M_M2)		;V1.19
;V4.01		jp	mem_total_y2	;V1.19
mem_total_y1:				;V1.19
		ld	hl,IC_M
		call	ic_to_icbk	;V1.22
		ld	(SYM),S_ICM		;V1.26
		call	ic_print
		call	mem1_to_w2
		call	w2_to_w4	;V1.22	for average calc
		call	mem1_clear
		@CLB	(ICON_M)		;clear 'M'
mem_total_y2:				;V1.19
		ld	hl,W2
		call	wk_round		;W2(MEM1 value) rounding
		ld	(SYM),S_MTL
;V4.01		@IS_M2			;V2.13
;V4.01		j	t,mem_total_y3	;V2.13
;V4.01		ld	(SYM),S_M2TL	;V2.13
;V4.01		@BBS	(SW_EUROS,mem_total_y3)		;V2.15
;V4.01		ld	(SYM),S_STASTA			;V2.15
mem_total_y3:
		call	wk_print		;W2 print
		call	feed_1			;1 line feed
		call	w2_to_ten		;for display accumulator value(W2)
		@SEB	(F_FNEABL)	;V1.09
;V4.13		@CLB	(M_M2)		;V2.15
		j	function_end

;===============================================================================
;		FEED
;===============================================================================
;V2.03feed_key:
;V2.03		@BBC	(M_HAND,mem2_total)	;V1.20
;V2.03feed_key0:
;V2.03		call	kfeed_1
;V2.03		@BBS	(P_ERR,feed_key9)	;printer error?  yes->
;V2.03		@BBS	(SW_OFF_RT,feed_key9)	;power sw move to OFF? yes ->exit
;V2.03		@BBS	(F_HLD_FED,feed_key0)	;press and hold 'FEED' key?
;V2.03feed_key9:
;V2.03		ld	a,(PRE_KEY)	;V1.18
;V2.03		ld	(KEYIN),a	;V1.18
;v2.03		j	no_operation	
;==============================================================================

item_key:
;V4.01		@BBC	(SW_V15,item_key_start)		;V1.23
;V4.01		@BBC	(IC_PROG,item_key_start)	;V1.23
;V4.01		ld	(BLK_CT),0			;syncronize brinking
;V4.01		@CLB	(IC_PROG)			;V1.23
;V2.06		jp	function_end			;V1.23
item_key_start:
;V4.13		@CLB	(F_ICDSP)			;V1.23
;V2.21		@BBS	(F_HLD_SET,no_operation)	;V1.23
		ld	(DW_CT),IC_HOLD_TIM
		cmp	(PRE_KEY),K_CE			;V1.52
		j	eq,item_key_start0		;V1.52
		cmp	(PRE_KEY),K_CEC			;V1.52
		j	eq,item_key_start0		;V1.52
		@BBC	(F_TNKEY,item_key_start1)	;V1.52
item_key_start0:
;V2.10		ld	a,(PRE_KEY_BK)			;V1.52
;V2.10		jp	item_key_start2			;V1.52
item_key_start1:					;V1.52
		ld	a,(PRE_KEY)
;V3.05		cmp	a,K_PLS			;V2.12
;V3.05		j	eq,item_key_x		;V2.12
;V3.05		cmp	a,K_MIN			;V2.12
;V3.05		j	eq,item_key_x		;V2.12
;V3.05		cmp	a,K_MPL			;V2.12
;V3.05		j	eq,item_key_x		;V2.12
;V3.05		cmp	a,K_MMI			;V2.12
;V3.05		j	eq,item_key_x		;V2.12
;V3.05		cmp	a,K_M2PL		;V2.12
;V3.05		j	eq,item_key_x		;V2.12
;V3.05		cmp	a,K_M2MI		;V2.12
;V3.05		j	eq,item_key_x		;V2.12
;V3.05		jp	item_key_y		;V2.12
;V3.05item_key_x:					;V2.12
;V3.05		ld	(KEYIN),a		;V2.12
item_key_y:					;V2.12

item_key_start2:
;V3.01		cmp	a,K_MPL
;V3.01		j	eq,mem_item_print
;V3.01		cmp	a,K_MMI
;V3.01		j	eq,mem_item_print
		cmp	a,K_MST
		j	eq,mt_item_print
		cmp	a,K_MTL
		j	eq,mt_item_print

;V4.01		cmp	a,K_M2PL
;V4.01		j	eq,mem_item_print
;V4.01		cmp	a,K_M2MI
;V4.01		j	eq,mem_item_print
;V4.01		cmp	a,K_M2ST
;V4.01		j	eq,m2t_item_print
;V4.01		cmp	a,K_M2TL
;V4.01		j	eq,m2t_item_print

;V4.11		cmp	a,K_GT
;V4.11		j	eq,gt_item_print
		cmp	a,K_ST
		j	eq,acc_item_print
		cmp	a,K_TL
		j	eq,acc_item_print

		@BBS	(F_ICPN,item_print)
		ld	(SYM),S_SPC
		ld	hl,IC_A
		call	ic_to_icbk		;V1.23
		call	ic_print00		;V1.24
;V3.00		call	ic_print	;V3.00
		ld	hl,IC_BK		;V1.24
		call	ic_to_ten		;V1.24
;V4.11		@BBC	(SW_V15,function_end)	;V1.23
;V4.11		@SEB	(F_ICDSP)		;V1.23
		jp	function_end
acc_item_print:
		ld	(SYM),S_SPC
		jp	average_item_print
m2t_item_print:
;V2.15		ld	(SYM),S_ICM
;V2.15		jp	average_item_print
gt_item_print:
		ld	(SYM),S_G
		@BBS	(SW_EUROS,gt_item_print1)
		ld	(SYM),S_STASTA
gt_item_print1:
		jp	average_item_print
mt_item_print:
		ld	(SYM),S_ICM
		jp	average_item_print

mem_item_print:
		ld	hl,IC_M
		call	ic_to_icbk	;V1.23
		ld	(SYM),S_ICM
		jp	item_print
average_item_print:
		@BBC	(F_ICPN,item_print)
average_calc:
		call	w4_to_w1
		ld	hl,IC_BK	;V1.22
		call	icbk_to_w2	;V1.22
		call	calc_div
		@BBS	(F_CALER,item_key_end)
		ld	a,(SYM)
		push	a
		ld	(SYM),S_AVR
		ld	hl,W1
		call	wk_round
		call	wk_print
		call	feed_1
		call	w1_to_ten
		pop	a
		ld	(SYM),a
;V3.02		cmp	(PRE_KEY),K_MST	;V2.09
;V3.02		j	eq,item_key_end	;V2.09
		cmp	(PRE_KEY),K_M2ST;V2.09
		j	eq,item_key_end	;V2.09
;V3.02		cmp	(PRE_

⌨️ 快捷键说明

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