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

📄 business_fn.asm

📁 calculator code ,use toshibaor nec LSI
💻 ASM
📖 第 1 页 / 共 5 页
字号:
S_MUL		equ	0x09		;' X'
S_DIV		equ	0x0a		;' '+waru
S_EQU		equ	0x0b		;' ='
S_AST		equ	0x0c		;' *'
S_AVR		equ	0x0c		;' *'
S_CLR		equ	0x0d		;'c '
S_MTL		equ	0x0e		;'MT'
S_MST		equ	0x0f		;'MS'
S_MPL		equ	0x10		;'M+'
S_MMI		equ	0x11		;'M-'
S_M2TL		equ	0x12		;'MIIT'
S_M2ST		equ	0x13		;'MIIS'
S_M2PL		equ	0x14		;'MII+'
S_M2MI		equ	0x15		;'MII-'
S_PER_K		equ	0x16		;' %'  for function key(in box)
S_PRDS		equ	0x17		;'-%'
S_PRAD		equ	0x18		;'+%'
S_DLTA_K	equ	0x19		;delta+' ' for function key(in box)
S_PRDL		equ	0x1a		;delta+'%'
S_DLAS		equ	0x1b		;delta+'*'
S_PRMU		equ	0x1c		;' %'
S_MKUP		equ	0x1d		;'MU'
;S_RVS		equ	0x1e		;' '+up/down allow
S_EUAS		equ	0x1e		;'Euro *'	V3.14

S_MTH		equ	0x1f		;M	V3.13
S_ROOT		equ	0x20		;'R '
S_TAX		equ	0x21		;'TX%'
;S_PRN		equ	0x22		;' S'
S_PAY		equ	0x22		;P	V3.13
S_EUR		equ	0x23		;'K '(fcR)
;S_EUM		equ	0x24		;'K-'
S_EUROS		equ	0x24		;'Euro'
S_EUEQ		equ	0x25		;'Euro ='
S_COST		equ	0x26		;'C '
S_SELL		equ	0x27		;' S'
S_MARG		equ	0x28		;'M%'
S_TAXA		equ	0x29		;' T'
S_ICG		equ	0x2a		;'G '
S_G		equ	0x2a
S_ICM		equ	0x2b		;' M '
S_M		equ	0x2b
;V4.02S_LCL		equ	0x2c		;home+waru	1450TE V1.01
;V4.02S_LCAS		equ	0x2d		;home+*		1450TE V1.01
;V4.02S_FC		equ	0x2e		;euro+ x	1450TE V1.01
;V4.02S_FCAS		equ	0x2f		;euro+*		1450TE V1.01
S_DLTA		equ	0x2c;V4.020x30		;delta+' '
S_PER		equ	0x2d;V4.020x31		;delta+' '
;S_EQU_A	equ	;0x32		;
S_CPAY		equ	0x2e;V4.020x32		;P*	V3.13
S_TXPL		equ	0x2f;V4.020x33		;TX+
S_TXMI		equ	0x30;V4.020x34		;TX-
S_TLMGT		equ	0x31;V4.020x35		;TL M+
S_TX1PL		equ	0x32;V4.020x36		;TX1+
S_TX1MI		equ	0x33;V4.020x37		;TX1-
S_TX2PL		equ	0x34;V4.020x38		;TX2+
S_TX2MI		equ	0x35;V4.020x39		;TX2-
S_TAX1		equ	0x36;V4.020x3a		;T1%
S_TAX2		equ	0x37;V4.020x3b		;T2%
;V4.02S_GPM		equ	0x3c		;GPM(MU)
;V4.02S_GS		equ	0x3d
;V4.02S_GT		equ	0x3d		;GT
;V4.02S_GPL		equ	0x3e		;G+  for sigama=% when TA mode	V2.11


S_STAMN		equ	0x55
S_STAS		equ	0x56
S_STASTA	equ	0x57


;V3.00S_GS		equ	0x0f		;G dia	GT subtotal
;V3.00S_GT		equ	0x10		;G *	GT total
;V3.00S_PRM		equ	0x11		;- %	percent minus
;V3.00S_PRP		equ	0x12		;+ %	percent plus
;V3.00S_DLP		equ	0x13		;d +	delta plus(for tax+)
;V3.00S_DLM		equ	0x14		;d -	delta plus(for tax-)
;V3.00S_AM		equ	0x15		;A M	time print
;V3.00S_PM		equ	0x16		;P M	time print
;V3.00S_CST		equ	0xb7;0x17		;C *	cost price
;V3.00S_SEL		equ	0x26;0x18		;S *	selling price
;V3.00S_MAR		equ	0xa1;0x19		;M %	margine %
;V3.00S_MU		equ	0xa2;0x1a		;M _	mark up
;V3.00S_MUD		equ	0x57;0x1b		;d *	delta of mark up
;V3.00S_SET		equ	0x27;0x1d		;_ *	for rate,time set(* only)
;V3.00S_SHD		equ	0x22;0x1c		;_ _	for #/D print(space)
;V3.00S_TLG		equ	0x93;0x0a		;G +	total key with GT position
;==============================================================================
;V3.00S_FED		equ	0x00		;fh+' '
;V3.00S_PWR		equ	0x17		;'C*'
;V3.00S_PLS		equ	0x01		;' +'
;V3.00S_MIN		equ	0x02		;' -'
;V3.00S_SPC		equ	0x00		;'  '
;V3.00S_SHP		equ	0x26		;' <>'
;V3.00S_TL		equ	0x22		;' *'
;V3.00S_TLGT		equ	0x3c		;'*+'
;V3.00S_TLMGT		equ	0x3d		;'*+'
;V3.00S_ST		equ	0x08		;' <>'
;V3.00S_MUL		equ	0x03		;' X'
;V3.00S_DIV		equ	0x04		;' /'
;V3.00S_EQU		equ	0x05		;' ='
;V3.00S_AST		equ	0x22		;' *'
;V3.00S_CLR		equ	0x07		;'c '
;V3.00S_MTL		equ	0x0e		;'M*'
;V3.00S_MST		equ	0x0d		;'M<>'
;V3.00S_MPL		equ	0x0b		;'M+'
;V3.00S_MMI		equ	0x0c		;'M-'
;V3.00S_M2TL		equ	0x10		;'G*'
;V3.00S_STASTA	equ	0x77	;'**' 
;V3.00S_M2ST		equ	0x0f		;'G<>'
;V3.00S_STAS		equ	0x76	;'*S'
;V3.00S_M2PL		equ	0x3e		;'G+'
;V3.00S_STAPL		equ	0x73	;'*+' 
;V3.00S_PLSTA		equ	0x37	;'+*'
;V3.00S_M2MI		equ	0x3f		;'G-'
;V3.00S_STAMN		equ	0x70	;'*-' 
;V3.00S_M2TLV		equ	0x97		;'G*'
;V3.00S_M2STV		equ	0x96		;'G<>'
;V3.00S_M2PLV		equ	0x3e		;'G+'
;V3.00S_M2MIV		equ	0x3f		;'G-'
;V3.00S_PER		equ	0x06		;' %'
;V3.00S_STAPER	equ	0x71		;'*%'
;V3.00S_PRDS		equ	0x01		;'-%'
;V3.00S_PRAD		equ	0x31		;'+%'
;V3.00S_DLTAL		equ	0x82		;delta+' '
;V3.00S_DLTA		equ	0x28		;' "+delta V1.26
;V3.00S_PRDL		equ	0x81		;delta+'%'
;V3.00S_DLAS		equ	0x87		;delta+'*'
;V3.00S_PRMU		equ	0x21		;' %'
;V3.00S_MKUP		equ	0xa2		;'M '
;V3.00S_RVS		equ	0x22		;'  '
;V3.00S_AVR		equ	0x27		;' *'
;V3.00S_ROOT		equ	0x22		;'  '
;V3.00S_TAX		equ	0x12		;'% '
;V3.00S_PRN		equ	0x62		;'<> '
;V3.00S_EUR		equ	0x22		;'  '
;V3.00S_EUEQ		equ	0xc2		;'= '
;V3.00S_COST		equ	0x2b		;' C'
;V3.00S_SELL		equ	0x26		;' <>'
;V3.00S_M		equ	0x2a		;' M'
;V3.00S_MARG		equ	0xa1		;'M%'
;V3.00S_PERMARG	equ	0x1a		;'%M'
;V3.00S_TAXA		equ	0x27		;' *'
;V3.00S_ICG		equ	0x29		;' G'
;V3.00S_ICGV		equ	0x29		;' G'
;V3.00S_ICM		equ	0x2a		;' M'
;V3.00S_ASM		equ	0x7a		;'*M'
;V3.00S_ASC		equ	0x7b		;'*C'
;V3.00S_ASDL		equ	0x78		;'*'+delta
;V3.00S_MIPL		equ	0x03		;'-+'	
;V3.00S_MIMI		equ	0x00		;'--'
;V3.00S_MIST		equ	0x06		;'-S'
;V3.00S_MITL		equ	0x07		;'-T'
;V3.00S_EUROS		equ	0x29		;' euro'
;V3.00S_G		equ	0x9f		;'G '
;V3.00S_GPL		equ	0x93		;'G+'
;V3.00S_GAST		equ	0x97		;'G*'
;==============================================================================
P_SPC	equ	0x20	;for print " "
;-----------------------------------------------------------
;interrupt enable flag set:

EF4		equ	4;(EIRL).4 /INT0
EF5		equ	5;(EIRL).5 INTTC1
EF6		equ	6;(EIRL).6 INT1
EF7		equ	7;(EIRL).7 INTTBT
EF8		equ	0;(EIRH).0 INTTC3
EF9		equ	1;(EIRH).1 INTSIO(High speed SIO interrupt)
EF10		equ	2;(EIRH).2 INTTC4
EF11		equ	3;(EIRH).3 INT3
EF12		equ	4;(EIRH).4 INT4
EF13		equ	5;(EIRH).5 INTTC2
EF14		equ	6;(EIRH).6 /INT5
EF15		equ	7;(EIRH).7 INTADC or INT2
;interrupt request flag set:
IL2		equ	2;(ILL).2 INTSWI 
IL3		equ	3;(ILL).3 INTATRAP
IL4		equ	4;(ILL).4 /INT0
IL5		equ	5;(ILL).5 INTTC1
IL6		equ	6;(ILL).6 INT1
IL7		equ	7;(ILL).7 INTTB
IL8		equ	0;(ILH).0 INTTC3
IL9		equ	1;(ILH).1 INTSIO
IL10		equ	2;(ILH).2 INTTC4
IL11		equ	3;(ILH).3 INT3
IL12		equ	4;(ILH).4 INT4
IL13		equ	5;(ILH).5 INTTC2
IL14		equ	6;(ILH).6 /INT5
IL15		equ	7;(ILH).7 INTADC or /INT2
;	DBR_LCD_RATE		equ	(0x0f33<<4)+5	;LCD DBR matrix point for "RATE"
;	DBR_LCD1235_RATE	equ	(0x0f33<<4)+3	;LCD DBR matrix point for "RATE"
;	DBR_LCD1297_RATE	equ	(0x0f33<<4)+4	;LCD DBR matrix point for "RATE"
;	DBR_LCD120_RATE		equ	(0x0f33<<4)+4	;LCD DBR matrix point for "RATE"
;	DBR_LCD1297_GT		equ	(0x0f32<<4)+2	;LCD DBR matrix point for "GT"
;	;LCD_PRN		equ	(0x0f31<<4)+3	;LCD DBR matrix point for "PRINT"
;	;LCD_FIN		equ	(0x0f30<<4)+3	;LCD DEB matrix point for "FIN"

AUTOOFFTIME	equ	31250;1500
	$list

	public	tax_plus,tax_minus,cost_key,sell_key,margin_key,tax_save,tax_recall,kychk_clcsm;wk_prn_2L
	public	rate_key,euro_key,local_key,check_dp_over2,rate_ten_key;,keychk_amortize
	public	euro_display,eurate_minus_key,eurate_plus_key,init_rate_dispaly,fix_euro_to_ten
	public	tax2_plus,tax2_minus,tax_plus,tax_minus,tax_plus_a,tax12_plus,tax12_minus,tax_minus_a
	public	keep_ten_6dig,euro_rate_recall_x,euro_set_sub
	extern	function_end,no_operation,wk_round_0
	extern	mem2_plus,mem2_minus,move_to_ten
	extern	edit_prn	;V2.08
	public	tax_plus_x,tax_minus_x	;V2.18
	public	rate_ten_key_01,fix_euro_to_ten,euro_print
	extern	euro_fix_rate_tbl,wk_print9
	public	rate_ten_key_01	;V4.12

ROM	section	code
RATE_HOLD_TIM	equ	150
;===============================================================================
;		RATE key
;===============================================================================
rate_ten_key:
		cmp	(KEYIN),K_ZERO2
		j	ge,no_operation
	ld	wa,F_TNKEY
	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
	j	t,rate_ten_key_00y		;if jump status is 1 -> branch
		ld	hl,TENKEY		;V3.07
		call	_zerock			;V3.07
		j	eq,rate_ten_key_01	;V3.07
rate_ten_key_00y:
	ld	wa,EURO_PROG
	clr	(EURO_PROG>>4).a
	ld	wa,F_COUNTRY
	test	(F_COUNTRY>>4).a		;bit -reverse-> jump status
	j	t,rate_ten_key_0		;if jump status is 1 -> branch
	ld	wa,F_COUNTRY
	clr	(F_COUNTRY>>4).a
;V4.18		ld	w,(COUNTRY_TEN)
;V4.18		ld	a,10
;V4.18		mul	w,a
;V4.18		clr	cf
		ld	a,(COUNTRY_TEN)	;V4.18
		add	a,(KEYIN)
		ld	(COUNTRY_TEN),a		;get country code
		cmp	(COUNTRY_TEN),17
		j	ge,rate_ten_key_00
	ld	wa,EURO_PROG
	set	(EURO_PROG>>4).a
	ld	wa,F_TNKEY
	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
	j	f,rate_ten_key_000		;if jump status is 0 -> branch
		cmp	(COUNTRY_TEN),12
		j	ge,rate_ten_key_00x

		call	fix_euro_to_ten

		jp	rate_ten_key_001
rate_ten_key_00x:
		ld	a,(COUNTRY_TEN)
		set	cf
		sub	a,12
		call	ee_to_ten
		call	keep_ten_6dig
		jp	rate_ten_key_001

rate_ten_key_000:

		cmp	(COUNTRY_TEN),12
		j	lt,rate_ten_key_00
rate_ten_key_001:
		call	euro_display
		jp	rate_key_end

rate_ten_key_00:
		ld	a,(KEYIN)
		ld	(DISP+6),a
;V4.17		j	rate_ten_key_01
		j	rate_ten_key_01x	;V4.17
rate_ten_key_0:
	ld	wa,F_TNKEY
	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
	j	f,rate_ten_key_0x		;if jump status is 0 -> branch
		ld	a,(KEYIN)
		jp	rate_ten_key_0y
rate_ten_key_0x:
		ld	hl,TENKEY		;V3.06
		call	_zerock			;V3.06
		j	eq,rate_ten_key_01	;V3.06
		ld	a,(KEYIN)
	;	cmp	a,1
	;	j	lt,rate_ten_key_01
rate_ten_key_0y:
		ld	(DISP+5),a
		ld	(DISP+6),D_SPC
		ld	w,a		;V4.18
		ld	a,10		;V4.18
		mul	w,a		;V4.18
		ld	(COUNTRY_TEN),a	;V4.18
		cmp	a,17		;V4.18
;V4.18		cmp	a,2
		j	lt,rate_ten_key_1
		j	rate_ten_key_01x	;V4.17
rate_ten_key_01:
		ld	hl,TENKEY		;V4.12
		call	_zerock			;V4.12
		j	nz,rate_ten_key_01x	;V4.12
		call	ten_clear		;V4.12
;		@CLB	(F_TNKEY)		;V4.12
	ld	wa,F_DPIN
	clr	(F_DPIN>>4).a
;		@CLB	(F_MIN_TRA)		;V4.12
		ld	(TEN_CT),0		;V4.12
		ld	(DT_CT),0		;V4.12
		call	spc_disp		;V4.12
		ld	hl,TENKEY		;V4.12
		call	edit_disp		;V4.12
rate_ten_key_01x:				;V4.12
	ld	wa,F_CALER
	set	(F_CALER>>4).a
	ld	wa,ICON_E
	set	(ICON_E>>4).a
		ld	a,(KEYIN)	;V4.12a
		ld	(PRE_KEY),a	;V4.12a
		j	rate_key_end_99
rate_ten_key_1:
		ld	(COUNTRY_TEN),a
	ld	wa,F_COUNTRY
	set	(F_COUNTRY>>4).a
		j	rate_key_end_99
		;------------------------------
fix_euro_to_ten:
		ld	w,(COUNTRY_TEN)
		ld	a,8
		mul	w,a
		ld	c,a
		ld	b,0
		ld	ix,euro_fix_rate_tbl
		clr	cf
		add	ix,bc
		call	move_to_ten
		ld	hl,TENKEY
		call	stg_sfr49
		ld	hl,TENKEY
		call	stg_sfr49
		ret
;====================================================================
rate_key:
		ld	a,(FLG_E)			;V3.04
		or	a,(FLG_C)			;V3.04
		and	a,0y01111111			;V3.04
		j	ne,no_operation			;V3.04
		cmp	(PRE_KEY),K_PLS
		j	eq,no_operation
		cmp	(PRE_KEY),K_MIN
		j	eq,no_operation
	ld	wa,EURO_PROG
	test	(EURO_PROG>>4).a		;bit -reverse-> jump status
	j	f,no_operation		;if jump status is 0 -> branch
	ld	wa,F_COUNTRY
	test	(F_COUNTRY>>4).a		;bit -reverse-> jump status
	j	f,no_operation		;if jump status is 0 -> branch

		cmp	(PRE_KEY),K_EURO_LOCAL_TAX_DUM
		j	ne,rate_key_0
		call	ten_clear
		jp	rate_key_enter_rate_mode
rate_key_0:
	ld	wa,F_TNKEY
	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
	j	f,rate_key_1		;if jump status is 0 -> branch
		ld	hl,TENKEY
		call	_zerock
		j	ne,no_operation
		ld	a,(TENKEY+OFF_DP)
		j	ne,no_operation
        test	(FLG_MODE).2
	j	t,rate_key_1
		test	(TEN_S).0	;V4.12
		j	f,no_operation	;V4.12
;V3.01		call	ten_clear		;V1.26
rate_key_1:
	ld	wa,F_RATE
	set	(F_RATE>>4).a
		ld	a,(TENKEY)
		j	ne,rate_key_2
		call	ten_to_w1
		call	w2_clear
		ld	(W2+4),0x01	;set w2=1000000
		xor	(W2_S),1
		call	calc_add
		test	(W1_S).0
		j	f,rate_key_enter_rate_mode
rate_key_2:
	ld	wa,ICON_E
	set	(ICON_E>>4).a
	ld	wa,F_CALER
	set	(F_CALER>>4).a
		call	ten_clear
		ld	a,(KEYIN)	;V4.17
		ld	(PRE_KEY),a	;V4.17
		jp	rate_key_end_9
rate_key_enter_rate_mode:
	ld	wa,F_RATE
	set	(F_RATE>>4).a
		call	to_dec_ten_digit
;V3.01		@CLB	(RATE_PROG)	;V1.09
;V3.01		@CLB	(EURO_PROG)	;V1.09
;V4.13		@CLB	(M_TX2)		;V2.07
;V4.13		@CLB	(M_TX1)		;V2.07
;V1.30		@SEB	(SW_RAT_RT)
		ld	(DW_CT),RATE_HOLD_TIM
;V1.09		@BBS	(F_RATE,no_operation)

rate_key_end_9:
		call	spc_disp
		ld	hl,TENKEY
		call	edit_disp
rate_key_end_99:
		ld	(DISP+2),D_S
		ld	(DISP+3),D_E
		ld	(DISP+4),D_T
		call	disp_to_dbr
rate_key_end:
;V3.01		jp	function_end
		jp	no_operation	;V3.01
;=============================================================================

⌨️ 快捷键说明

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