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

📄 basic_fn.med

📁 calculator code ,use toshibaor nec LSI
💻 MED
📖 第 1 页 / 共 5 页
字号:
 =1   620       ;V3.00S_MIN		equ	0x02		;' -'
 =1   621       ;V3.00S_SPC		equ	0x00		;'  '
 =1   622       ;V3.00S_SHP		equ	0x26		;' <>'
 =1   623       ;V3.00S_TL		equ	0x22		;' *'
 =1   624       ;V3.00S_TLGT		equ	0x3c		;'*+'
 =1   625       ;V3.00S_TLMGT		equ	0x3d		;'*+'
 =1   626       ;V3.00S_ST		equ	0x08		;' <>'
 =1   627       ;V3.00S_MUL		equ	0x03		;' X'
 =1   628       ;V3.00S_DIV		equ	0x04		;' /'
 =1   629       ;V3.00S_EQU		equ	0x05		;' ='
 =1   630       ;V3.00S_AST		equ	0x22		;' *'
 =1   631       ;V3.00S_CLR		equ	0x07		;'c '
 =1   632       ;V3.00S_MTL		equ	0x0e		;'M*'
 =1   633       ;V3.00S_MST		equ	0x0d		;'M<>'
 =1   634       ;V3.00S_MPL		equ	0x0b		;'M+'
 =1   635       ;V3.00S_MMI		equ	0x0c		;'M-'
 =1   636       ;V3.00S_M2TL		equ	0x10		;'G*'
 =1   637       ;V3.00S_STASTA	equ	0x77	;'**' 
 =1   638       ;V3.00S_M2ST		equ	0x0f		;'G<>'
 =1   639       ;V3.00S_STAS		equ	0x76	;'*S'
 =1   640       ;V3.00S_M2PL		equ	0x3e		;'G+'
 =1   641       ;V3.00S_STAPL		equ	0x73	;'*+' 
 =1   642       ;V3.00S_PLSTA		equ	0x37	;'+*'
 =1   643       ;V3.00S_M2MI		equ	0x3f		;'G-'
 =1   644       ;V3.00S_STAMN		equ	0x70	;'*-' 
 =1   645       ;V3.00S_M2TLV		equ	0x97		;'G*'
 =1   646       ;V3.00S_M2STV		equ	0x96		;'G<>'
 =1   647       ;V3.00S_M2PLV		equ	0x3e		;'G+'
 =1   648       ;V3.00S_M2MIV		equ	0x3f		;'G-'
 =1   649       ;V3.00S_PER		equ	0x06		;' %'
 =1   650       ;V3.00S_STAPER	equ	0x71		;'*%'
 =1   651       ;V3.00S_PRDS		equ	0x01		;'-%'
 =1   652       ;V3.00S_PRAD		equ	0x31		;'+%'
 =1   653       ;V3.00S_DLTAL		equ	0x82		;delta+' '
 =1   654       ;V3.00S_DLTA		equ	0x28		;' "+delta V1.26
 =1   655       ;V3.00S_PRDL		equ	0x81		;delta+'%'
 =1   656       ;V3.00S_DLAS		equ	0x87		;delta+'*'
 =1   657       ;V3.00S_PRMU		equ	0x21		;' %'
 =1   658       ;V3.00S_MKUP		equ	0xa2		;'M '
 =1   659       ;V3.00S_RVS		equ	0x22		;'  '
 =1   660       ;V3.00S_AVR		equ	0x27		;' *'
 =1   661       ;V3.00S_ROOT		equ	0x22		;'  '
 =1   662       ;V3.00S_TAX		equ	0x12		;'% '
 =1   663       ;V3.00S_PRN		equ	0x62		;'<> '
 =1   664       ;V3.00S_EUR		equ	0x22		;'  '
 =1   665       ;V3.00S_EUEQ		equ	0xc2		;'= '
 =1   666       ;V3.00S_COST		equ	0x2b		;' C'
 =1   667       ;V3.00S_SELL		equ	0x26		;' <>'
 =1   668       ;V3.00S_M		equ	0x2a		;' M'
 =1   669       ;V3.00S_MARG		equ	0xa1		;'M%'
 =1   670       ;V3.00S_PERMARG	equ	0x1a		;'%M'
 =1   671       ;V3.00S_TAXA		equ	0x27		;' *'
 =1   672       ;V3.00S_ICG		equ	0x29		;' G'
 =1   673       ;V3.00S_ICGV		equ	0x29		;' G'
 =1   674       ;V3.00S_ICM		equ	0x2a		;' M'
 =1   675       ;V3.00S_ASM		equ	0x7a		;'*M'
 =1   676       ;V3.00S_ASC		equ	0x7b		;'*C'
 =1   677       ;V3.00S_ASDL		equ	0x78		;'*'+delta
 =1   678       ;V3.00S_MIPL		equ	0x03		;'-+'	
 =1   679       ;V3.00S_MIMI		equ	0x00		;'--'
 =1   680       ;V3.00S_MIST		equ	0x06		;'-S'
 =1   681       ;V3.00S_MITL		equ	0x07		;'-T'
 =1   682       ;V3.00S_EUROS		equ	0x29		;' euro'
 =1   683       ;V3.00S_G		equ	0x9f		;'G '
 =1   684       ;V3.00S_GPL		equ	0x93		;'G+'
 =1   685       ;V3.00S_GAST		equ	0x97		;'G*'
 =1   686       ;==============================================================================
 =1   687       P_SPC	equ	0x20	;for print " "
 =1   688       ;-----------------------------------------------------------
 =1   689       ;interrupt enable flag set:
 =1   690       
 =1   691       EF4		equ	4;(EIRL).4 /INT0
 =1   692       EF5		equ	5;(EIRL).5 INTTC1
 =1   693       EF6		equ	6;(EIRL).6 INT1
 =1   694       EF7		equ	7;(EIRL).7 INTTBT
 =1   695       EF8		equ	0;(EIRH).0 INTTC3
 =1   696       EF9		equ	1;(EIRH).1 INTSIO(High speed SIO interrupt)
 =1   697       EF10		equ	2;(EIRH).2 INTTC4
 =1   698       EF11		equ	3;(EIRH).3 INT3
 =1   699       EF12		equ	4;(EIRH).4 INT4
 =1   700       EF13		equ	5;(EIRH).5 INTTC2
 =1   701       EF14		equ	6;(EIRH).6 /INT5
 =1   702       EF15		equ	7;(EIRH).7 INTADC or INT2
 =1   703       ;interrupt request flag set:
 =1   704       IL2		equ	2;(ILL).2 INTSWI 
 =1   705       IL3		equ	3;(ILL).3 INTATRAP
 =1   706       IL4		equ	4;(ILL).4 /INT0
 =1   707       IL5		equ	5;(ILL).5 INTTC1
 =1   708       IL6		equ	6;(ILL).6 INT1
 =1   709       IL7		equ	7;(ILL).7 INTTB
 =1   710       IL8		equ	0;(ILH).0 INTTC3
 =1   711       IL9		equ	1;(ILH).1 INTSIO
 =1   712       IL10		equ	2;(ILH).2 INTTC4
 =1   713       IL11		equ	3;(ILH).3 INT3
 =1   714       IL12		equ	4;(ILH).4 INT4
 =1   715       IL13		equ	5;(ILH).5 INTTC2
 =1   716       IL14		equ	6;(ILH).6 /INT5
 =1   717       IL15		equ	7;(ILH).7 INTADC or /INT2
 =1   718       ;	DBR_LCD_RATE		equ	(0x0f33<<4)+5	;LCD DBR matrix point for "RATE"
 =1   719       ;	DBR_LCD1235_RATE	equ	(0x0f33<<4)+3	;LCD DBR matrix point for "RATE"
 =1   720       ;	DBR_LCD1297_RATE	equ	(0x0f33<<4)+4	;LCD DBR matrix point for "RATE"
 =1   721       ;	DBR_LCD120_RATE		equ	(0x0f33<<4)+4	;LCD DBR matrix point for "RATE"
 =1   722       ;	DBR_LCD1297_GT		equ	(0x0f32<<4)+2	;LCD DBR matrix point for "GT"
 =1   723       ;	;LCD_PRN		equ	(0x0f31<<4)+3	;LCD DBR matrix point for "PRINT"
 =1   724       ;	;LCD_FIN		equ	(0x0f30<<4)+3	;LCD DEB matrix point for "FIN"
 =1   725       
 =1   726       AUTOOFFTIME	equ	31250;1500
      727       	$list
      728       
      729       	public	tenkey,dp_key,gt_key,cec_key,acc_plus,acc_minus,acc_subtl,acc_total
      730       	public	equal_key,percent_key,perplus_key,multi_key,divide_key,sharp_subtl ;V2.03feed_key,
      731       	public	markup_key,delta_percent,sign_change,back_space,sharp_date,all_clear,work_clear,work_clear_acc
      732       	public	mem_minus,mem_plus,mem_subtl,mem_total,mem2_minus,mem2_plus,mem2_subtl,mem2_total
      733       	public	ce_key,item_key,tenkey,enter_stop;V2.03prn_mode_key,off_key,fin_mode_key,decimal_set_key,
      734       	public	square_root,mem2_plus,mem2_minus,equal_sub
      735       	extern	function_end,tenkey_end,no_operation,shp_sgn_end ;V2.03,feed_key_end
      736       	extern	init_scan,init_io,function_end9,function_end_0;V2.00init_lcd,init_pf
      737       	extern	check_dp_over2	;key_amount,key_interest,key_month,key_payment,
      738       	extern	eurate_minus_key,eurate_plus_key,resume,rate_ten_key;lcd_display_exp,
      739       ;V3.00	extern	time_key,rtc_key_equ,rtc_key_mul,rtc_key_div
      740       	extern	tax2_plus,tax2_minus,tax_plus,tax_minus,tax_plus_a,tax12_plus,tax12_minus
      741       	extern	functionnoclearftenkey,lcd_display_exp,tax_minus_a,tax_plus_x,tax_minus_x
      742       	extern	keep_ten_6dig,rate_ten_key_01,fix_euro_to_ten,euro_print,euro_display
      743       	extern	euro_rate_recall_x,euro_set_sub
      744       	extern	wk_print9,edit_prn
      745       	extern	rate_ten_key_01	;V4.12
      746       ROM	section	code
      747       IC_HOLD_TIM	equ	150
      748       GT_HOLD_TIM	equ	150
      749       ;===============================================================================
      750       ;		Tenkey input
      751       ;===============================================================================
      752       tenkey:
      754 +1    	ld	wa,F_RATE
      755 +1    	test	(F_RATE>>4).a		;bit -reverse-> jump status
      756 +1    	j	f,rate_ten_key		;if jump status is 0 -> branch
      758 +1    	ld	wa,F_TNKEY
      759 +1    	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
      760 +1    	j	f,tenkey_st		;if jump status is 0 -> branch
      762 +1    	ld	wa,F_DPIN
      763 +1    	test	(F_DPIN>>4).a		;bit -reverse-> jump status
      764 +1    	j	f,tenkey_st		;if jump status is 0 -> branch
      765       		ld	a,(PRE_KEY)	;V1.52
      766       		ld	(PRE_KEY_BK),a	;V1.52 this only is used for [IC] after ten key entry
      768 +1    	ld	wa,F_TNKEY
      769 +1    	set	(F_TNKEY>>4).a
      770       		ld	a,(TEN_CT)
      771       		j	z,tenkey_00		;first tenkey entry?(TEN_CT=0)  yes ->
      772       tenkey_st:				;V1.24
      773       		ld	a,(TEN_CT)	;v1.24
      774       ;V1.21		cmp	a,MAX_DIGIT
      775       		push	wa		;V1.21
      777 +1    	ld	wa,M14
      778 +1    	test	(M14>>4).a		;bit -reverse-> jump status
      779 +1    	j	t,tenkey_x		;if jump status is 1 -> branch
      780       		pop	wa		;V1.21
      781       		cmp	a,14		;V1.21
      782       		jp	tenkey_z	;V1.21
      783       tenkey_x:				;V1.21
      785 +1    	ld	wa,M10
      786 +1    	test	(M10>>4).a		;bit -reverse-> jump status
      787 +1    	j	f,tenkey_y		;if jump status is 0 -> branch
      788       		pop	wa		;V1.21
      789       		cmp	a,12		;V1.21
      790       		jp	tenkey_z	;V1.21
      791       tenkey_y:
      792       		pop	wa		;V1.21
      793       		cmp	a,10		;V1.21
      794       tenkey_z:				;V1.21
      795       		j	lt,tenkey_01		;tenkey over flow? no ->
      796       		ld	b,0		;V3.05
      797       		jp	tenkey_01	;V3.07
      798       		j	no_operation		; over -> ignore current key
      799       tenkey_00:
      800       		call	ten_clear
      801       		call	spc_dt			;clear #/D key buffer
      802       		ld	(DT_CT),0		;clear #/D data entry counter
      803       		ld	(DT_DOT_CNT),0	;V1.06
      804       tenkey_01:
      805       		ld	b,0		;V3.07
      806       		ld	a,(KEYIN)		;check key code
      807       		cmp	a,K_ZERO		;0 key?
      808       		j	ne,tenkey_02		;no -> 
      809       		ld	b,0			;yes -> set no loop
      810       		j	tenkey_04
      811       tenkey_02:
      812       		cmp	a,K_ZERO2		;00 key?
      813       		j	ne,tenkey_03		;no ->
      814       		ld	b,1			;yes -> set loop 2times
      815       		j	tenkey_04
      816       tenkey_03:
      817       		cmp	a,K_ZERO3
      818       		j	ne,tenkey_06		;000 key? no ->
      819       		ld	b,2			;yes -> set loop 3times
      820       tenkey_04:
      821       		ld	(KEYIN),K_ZERO		;00,000 key  yes->over write 0 to key code
      823 +1    	ld	wa,F_DPIN
      824 +1    	test	(F_DPIN>>4).a		;bit -reverse-> jump status
      825 +1    	j	f,tenkey_08		;if jump status is 0 -> branch
      826       		cmp	(TEN_CT),0		;is it first zero entry?
      827       		j	ne,tenkey_08		; no -> 
      828       ;V3.06		cmp	(DT_CT),0	;V1.27
      829       ;V3.06		j	ne,tenkey_19	;V1.27
      830       
      831       tenkey_04x:
      832       		ld	w,(KEYIN)	;V3.10	;w <- tenkey data
      833       		call	dt_update	;V3.10	;DT_BUF update for #/D print
      834       		dec	b		;V3.10	;check loop counter
      835       		j	f,tenkey_04x	;V3.10	;if b is FFh? yes -> exit
      836       		jp	tenkey_19	;V3.10
      837       
      838       tenkey_06:
      839       ;V3.07		ld	b,0			;not 00,000 key -> set no loop
      840       tenkey_08:
      842 +1    	ld	wa,M14
      843 +1    	test	(M14>>4).a		;bit -reverse-> jump status
      844 +1    	j	f,tenkey_08x		;if jump status is 0 -> branch
      845       		cmp	(TEN_CT),12	;V3.07
      846       		jp	tenkey_09	;V4.07
      847       tenkey_08x:				;V4.07
      848       		cmp	(TEN_CT),14	;V4.06
      849       tenkey_09:				;V4.06
      850       		j	ge,tenkey_10	;V3.07
      851       		ld	hl,TENKEY
      852       		call	stg_sfl47		;TENKEY left shift by nibble
      853       		ld	a,(TEN_LSD)
      854       		or	a,(KEYIN)
      855       		ld	(TEN_LSD),a
      856       		inc	(TEN_CT)		;increment tenkey counter
      857       		inc	(DT_CHR_CNT)	;V1.06
      859 +1    	ld	wa,F_DPIN
      860 +1    	test	(F_DPIN>>4).a		;bit -reverse-> jump status
      861 +1    	j	t,tenkey_10		;if jump status is 1 -> branch
      862       		inc	(TEN_DP)		;increment DP counter
      863       tenkey_10:
      864       		ld	w,(KEYIN)		;w <- tenkey data
      865       		call	dt_update		;DT_BUF update for #/D print
      866       tenkey_11:
      867       		dec	b			;check loop counter
      868       		j	t,tenkey_19		;if b is FFh? yes -> exit
      869       ;V3.07		push	wa			;V1.21
      870       ;V3.07		@BBC	(M14,tenkey_10x)	;V1.21
      871       ;V3.07		cmp	(TEN_CT),14		;V1.21
      872       ;V3.07		jp	tenkey_10z		;V1.21
      873       ;V3.07tenkey_10x:					;V1.21
      874       ;V3.07		@BBS	(M10,tenkey_10y)	;V1.21
      875       ;V3.07		cmp	(TEN_CT),12		;V1.21
      876       ;V3.07		jp	tenkey_10z		;V1.21
      877       ;V3.07tenkey_10y:					;V1.21
      878       ;V3.07		cmp	(TEN_CT),10		;V1.21
      879       ;V3.07tenkey_10z:					;V1.21
      880       ;V3.07		pop	wa			;V1.21
      881       ;V3.10		j	lt,tenkey_08		; loop if not tenkey overflow(in case of 00,000 key)
      882       		jp	tenkey_08	;V3.10
      883       tenkey_19:
      884       		j	tenkey_end
      885       ;sub routine for #/D.........................
      886       ;input: reg.w <- entry data
      887       dt_update:
      888       		ld	a,(DT_CT)

⌨️ 快捷键说明

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