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

📄 main.med

📁 calculator code ,use toshibaor nec LSI
💻 MED
📖 第 1 页 / 共 5 页
字号:
 =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	start,function_end,tenkey_end,no_operation,init_io,resume,shp_sgn_end
      730       	public	sys_error,resume,function_end9,function_end_0,functionnoclearftenkey,ic_display
      731       	extern	euro_country_set
      732       	extern	key_get,init_keybuf,acc_total,enter_stop,ce_key ;check_slftst,init_rtc
      733       	extern	tenkey,dp_key,gt_key,cec_key,acc_plus,acc_minus,acc_subtl
      734       	extern	acc_total,sharp_subtl,equal_key,percent_key,perplus_key,multi_key,divide_key
      735       	extern	markup_key,delta_percent,sign_change,back_space,sharp_date
      736       	extern	mem_minus,mem_plus,mem_subtl,mem_total,mem2_minus,mem2_plus,mem2_subtl,mem2_total
      737       	extern	cost_key,sell_key,margin_key 
      738       	extern	tax_plus,tax_minus,tax2_plus,tax2_minus
      739       	extern	lcd_disable,lcd_enable,tax_save,tax_recall,all_clear,work_clear,work_clear_acc,kychk_clcsm;v3.00 rtc_key,
      740       	extern	spc_disp,update_md,wk_prn_2L
      741       	extern	euro_key,local_key,rate_key 
      742       	extern	init_rate_dispaly,keychk_amortize;,what_print_head
      743       	extern	square_root,item_key,mdsw_update,initial_mdsw_update,fix_euro_to_ten,check_slftst
      744       	extern	keep_ten_6dig
      745       ROM	section	code abs=0xa000
      746       
      747       MD_TIM	equ	20	;this already defined in key scan sub
      748       
      749       ;===============================================================================
      750       ;		Initialize
      751       ;===============================================================================
      752       start:						;reset or turn on power switch
      753       		ld	sp,RAM_BOT		;stack pointer initial
      754       		ld	(WDTCR2),0x4e		;WDT counter reset
      755       		ld	(WDTCR1),0y00110000	;WDT disable
      756       		ld	(WDTCR2),0xb1		;WDT disable code
      757       		ldw	(SYSCR1),0y1000000000000000
      758       ;				   ||
      759       ;                                  ||__turn off sub clock
      760       ;                                  |__turn on main clock 8MHz
      761       		call	init_io			;IO initialize
      762       ;RAM clear...............................................
      763       		ld	hl,RAM_TOP		;\
      764       		ld	a,0			;|
      765       ram_clr0:					;|
      766       		ld	(hl),a			;|
      767       		inc	hl			;|
      768       		cmp	hl,RAM_BOT		;/
      769       		j	le,ram_clr0		;
      770       
      771       ;V3.00		ld	(YEAR),0x05	;\
      772       ;V3.00		ld	(MON),0x01	;|
      773       ;V3.00		ld	(DAY),0x01	;|;initialize Time base timer for RTC
      774       		j	init_hw_wk	
      775       resume:
      776       ;RAM clear except RTC,TAX rate ..........................
      777       		ld	hl,RAM_TOP	;\
      778       		ld	a,0		;|
      779       ram_clr1:				;|clear RAM from RAM_TOP-->WO_CLR
      780       		ld	(hl),a		;|
      781       ram_clr2:
      782       		inc	hl		;|
      783       		cmp	hl,MDSW		; mdsw-->dp_pos no clear
      784       		j	lt,ram_clr3	;
      785       		cmp	hl,DP_POS	;
      786       		j	le,ram_clr2	;
      787       ram_clr3:				;
      788       		cmp	hl,W1_CLR	;/
      789       		j	lt,ram_clr1			;
      790       ;-------------------------------------------------------------
      791       		and	(FLG_ICON),0y00101100		;just keep ICOM_M and ICOM_GT and F_ICPM flag only 
      792       		call	gt_clear		;V1.30
      794 +1    	ld	wa,ICON_GT
      795 +1    	clr	(ICON_GT>>4).a
      796       		call	mem1_clear	;V1.39d
      798 +1    	ld	wa,ICON_M
      799 +1    	clr	(ICON_M>>4).a
      800       init_hw_wk:
      801       ;V3.00		ld	(T_Y20),0x20	;V1.32
      803 +1    	ld	wa,F_DOFF
      804 +1    	set	(F_DOFF>>4).a
      805       pwr_wait:
      807 +1    	ld	wa,IO_PF
      808 +1    	test	(IO_PF>>4).a		;bit -reverse-> jump status
      809 +1    	j	f,pwr_wait		;if jump status is 0 -> branch
      810       		nop			;V2.06 mode switch will be initialed in subroutine "initial_mdsw_update"
      811       		nop			;V2.06 
      812       		nop
      814 +1    	ld	wa,IO_PF
      815 +1    	test	(IO_PF>>4).a		;bit -reverse-> jump status
      816 +1    	j	f,pwr_wait		;if jump status is 0 -> branch
      817       		call	all_clear		;h/w initialize, work area clear, interrupt enable
      818       		call	model_select		;select printer model, logic model
      819       ;---------------------------------------------------------------
      820       ;V3.00		@BBS	(RTC_INIT,pwr_wait_z)	;V1.46
      821       ;V3.00		call	init_rtc		;V1.45
      822       pwr_wait_z:					;V1.45
      823       ;---------------------------------------------------------------
      824       		di
      825       		call	initial_mdsw_update	;V1.30;V1.27
      826       		ei
      827       		ld	(MDCHK),0			;V1.20
      828       		call	mdsw_update			;V1.20
      829       ;V4.13		@BBS	(SW_OFF_RT,init_hw_wk9)		;if OFF?  yes -> no initial print
      831 +1    	ld	wa,SW_NP_RT
      832 +1    	test	(SW_NP_RT>>4).a		;bit -reverse-> jump status
      833 +1    	j	f,pwr_wait_1		;if jump status is 0 -> branch
      834       ;V3.00		@BBC	(F_WAKE,pwr_wait_0)	;V1.17
      835       ;V3.00		call	feed_1
      837 +1    	ld	wa,F_INIREQ
      838 +1    	set	(F_INIREQ>>4).a
      840 +1    	ld	wa,M_5514T
      841 +1    	test	(M_5514T>>4).a		;bit -reverse-> jump status
      842 +1    	j	f,pwr_wait_0		;if jump status is 0 -> branch
      844 +1    	ld	wa,F_INIREQ
      845 +1    	clr	(F_INIREQ>>4).a
      846       		call	prn_init	;V3.00
      847       pwr_wait_0:					;V1.17
      849 +1    	ld	wa,P_ERR
      850 +1    	test	(P_ERR>>4).a		;bit -reverse-> jump status
      851 +1    	j	t,pwr_wait_1		;if jump status is 1 -> branch
      852       		call	prn_init			;printer initialize
      853       pwr_wait_1:
      854       ;//test		call	check_slftst
      855       		call	rate_init_check	
      857 +1    	ld	wa,RATE_INI
      858 +1    	test	(RATE_INI>>4).a		;bit -reverse-> jump status
      859 +1    	j	f,pwr_wait_2		;if jump status is 0 -> branch
      861 +1    	ld	wa,SW_NP_RT
      862 +1    	test	(SW_NP_RT>>4).a		;bit -reverse-> jump status
      863 +1    	j	f,init_hw_wk9		;if jump status is 0 -> branch
      864       		ld	(PRE_KEY),K_CEC		;
      866 +1    	ld	wa,M_5514T
      867 +1    	test	(M_5514T>>4).a		;bit -reverse-> jump status
      868 +1    	j	f,init_hw_wk9		;if jump status is 0 -> branch
      869       		call	wkup_print		;print 'C'
      870       
      871       		call	feed_1
      872       		jp	init_hw_wk9		;
      873       pwr_wait_2:					;
      874       		call	rate_init_flag_print	; out print to indicate all rate initialed
      875       init_hw_wk9:
      877 +1    	ld	wa,IO_MT
      878 +1    	test	(IO_MT>>4).a		;bit -reverse-> jump status
      879 +1    	j	f,init_hw_wk9		;if jump status is 0 -> branch
      880       		call	eeprom_check		;to check EEPROM initialed?
      881       		j	cc,no_init_eeprom	;EEPROM initialed?
      882       		call	ee_rate_init		;write check code into (EE_TEST)
      883       no_init_eeprom:
      884       		call	init_keybuf		;clear key counter,pointer
      886 +1    	ld	wa,RATE_INI
      887 +1    	test	(RATE_INI>>4).a		;bit -reverse-> jump status
      888 +1    	j	t,init_hw_wk90		;if jump status is 1 -> branch
      889       		call	ee_rate_init		;yes, initial
      891 +1    	ld	wa,EP_FAIL
      892 +1    	test	(EP_FAIL>>4).a		;bit -reverse-> jump status
      893 +1    	j	f,init_hw_wk90		;if jump status is 0 -> branch
      894       		call	init_rate_dispaly	;display "r-cc"
      895       wait_key_in:				
      896       		call	wait_50ms	
      897       wait_key_in_1:				
      898       		call	check_mdsw	;to check slide
      899       		cmp	(KEY_CT),0	
      900       		j	z,wait_key_in_1	
      901       		call	all_clear	
      902       		call	init_all_rate	
      903       		j	feed_key_end	
      904       init_hw_wk90:
      905       
      906       		call	init_keybuf		;clear key counter,pointer
      907       		call	init_all_rate		
      908       ;V4.13		@BBS	(SW_OFF_RT,main_loop)	;OFF position?  yes -> does not display for avoid display flash in OFF mode
      909       		j	feed_key_end		;'0' display and go to main loop
      910       
      911       
      912       ;===============================================================================
      913       ;	Main routine(wait for key entry and jump to each function)
      914       ;===============================================================================
      915       main_loop:
      916       ;V4.11		@BBS	(F_WAKE,enter_stop)	;jump to auto off function

⌨️ 快捷键说明

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