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

📄 main.mac

📁 calculator code ,use toshibaor nec LSI
💻 MAC
📖 第 1 页 / 共 2 页
字号:
error_rec_bs:					;v4.12
		@BBC	(EURO_PROG,error_bs)	;V4.12
		jp	no_operation		;V4.12
error_bs:					;V4.12
		cmp	(PRE_KEY),K_RATE	;V4.17
		j	eq,error_bs_0		;V4.17
		cmp	(PRE_KEY),K_EQU	;V4.12
		j	eq,error_bs_0	;V4.12
		cmp	(PRE_KEY),K_EURO	;V4.12a
		j	eq,error_bs_0		;V4.12a
		cmp	(PRE_KEY),K_LOCAL	;V4.12a
		j	eq,error_bs_0		;V4.12a
		@BBS	(F_COUNTRY,error_bs_0)	;V4.12a
		CMP	(COUNTRY_TEN),17	;V4.12
		j	ge,no_operation	;V4.12	;V4.12
		@BBC	(F_TNKEY,error_bs_0)	;V4.12
		cmp	(COUNTRY_TEN),12	;V4.12
		j	lt,no_operation		;V4.12
error_bs_0:					;V4.12
		@CLB	(F_RATE)		;V4.12
error_bs_1:					;V4.12
		@CLB	(F_COUNTRY)		;V4.12
		call	error_clr		;V4.10
		@BBS	(F_TNKEY,error_bs_2)	;V4.12
		call	ten_clear		;V4.12
error_bs_2:					;V4.12
		@CLB	(F_TNKEY)		;V4.10
		@CLB	(F_DPIN)		;V4.10
		@CLB	(F_MIN_TRA)		;V4.10
		@SEB	(EURO_DISPLY)		;V4.10
		ld	(TEN_CT),0		;V4.10
		ld	(DT_CT),0		;V4.10
		ld	(DT_DOT_CNT),0		;V4.10
		ld	(DT_CHR_CNT),0		;V4.10

		j	function_end99		;V4.10
;V4.10		j	error_rcv3
error_recov_x:
		cmp	(KEYIN),K_CE		;V1.24;-> recovery (clear 'E' icon only)
		j	eq,error_rcv2		;V1.24
		cmp	(KEYIN),K_CEC
		j	eq,error_rcv1		;-> recovery (clear 'E' display '0')
		j	no_operation
;CEC key.......
error_rcv1:
		@BBS	(P_ERR,error_rcv10)	;V1.31
		@BBC	(SW_AC,error_rcv2)	;V1.30
error_rcv10:
		ld	(FLG_E),0		;V1.13
		ld	(FLG_C),0		;V1.13
		@BBS	(P_ERR,error_rcvpe)	;printer error?  yes->;V1.36a V1.37
		call	error_clr		;clear F_ZDIVER, F_CALER, ICON_E
		j	cec_key
;V4.12		@CLB	(MEQ_ENB)		;not allow M+= or M-= calculation even having multi/div entry before
error_rcv2:
		@CLB	(F_COUNTRY)	;V3.07
		@IS_5514_OFF(error_rcv2_1)	;V4.12
		and	(FLG_E),0x0f		;V4.12
		and	(FLG_C),0x0f		;V4.12
error_rcv2_1:					;V4.12
;V3.04		ld	(FLG_E),0		;V1.32
;V3.04		ld	(FLG_C),0		;V1.32
		@BBS	(P_ERR,no_operation)	;printer error?  yes->
		call	ten_clear		;V1.30
;V1.30		@SEB	(ERR_CLR)		;set just after clear calculation error flag for chain multi/div function
error_rcv3:
		call	error_clr		;V1.30
error_rcv29:
		j	function_end		;

error_rcvpe:
		call	all_clear		;h/w initialize, work area clear, interrupt enable
		@CLB	(ICON_E)		;clear 'E'
		@CLB	(P_ERR)			;V1.08
		@CLB	(F_COUNTRY)	;V3.07
		call	error_clr		;V1.37
		call	spc_prnbuf		;V1.37
		ld	(PRN_BUF_LSD-1),ps_0	;v4.03
		ld	(PRN_BUF_LSD),ps_dot	;V4.03 "0." print out	V1.37
		ld	(PRN_BUF_SYM),S_CLR	;V4.03 'C ';V1.37

		@IS_LTP_OFF(error_rcvpe_1)		;V4.03
		ld	(PRN_BUF_LSD_LTP-1),ps_0	;V4.03
		ld	(PRN_BUF_LSD_LTP),ps_dot	;V4.03 "0." print out
		ld	(PRN_BUF_SYM_LTP),S_CLR		;V4.03 'C ';V1.37
error_rcvpe_1:						;V4.03

		call	print_bk		;V1.37

;V1.37		call	wkup_print		;V1.09 initial print
		call	feed_1			;V1.31
;V1.09		call	prn_init		;printer initialize
		j	error_rcv29


;clear all error flags.......
error_clr:
		@CLB	(F_ZDIVER)
		@CLB	(F_CALER)
		@CLB	(ICON_E)		;clear 'E'
		ret
;===============================================================================
;		Check mode key (ON-OFF,RATE-OFF,NP-PRN)
;===============================================================================
T_NPJG		equ	30				;7813us x 30 = 234.4ms (the value for judge NP -> P)
;T_NPJG		equ	20				;7813us x 20 = 156.3ms (the value for judge NP -> P)

check_mdsw:
;V4.11		@BBS	(F_OFF,check_md12)
;under ON condition........
;V4.11		@BBC	(SW_OFF_RT,check_md14)		;power sw move to OFF? no->
;V4.11		cmp	(KEY_CT),0			;KEY_CT=0?
;V4.11		j	ne,check_md14			;no -> not allow to enter OFF mode
;get into OFF mode(ON->OFF).....
;V4.11		@SEB	(F_OFF)				;
;V4.11		@SEB	(F_DOFF)	;V2.05
;V4.11		@CLB	(IC_PROG)	;
;V3.00		@CLB	(RTC_ON)	;V1.44
;V3.00		@CLB	(RTC_SET)	;V1.44
;V3.00		@CLB	(RTC_CHK)	;V2.12
;V4.11		@CLB	(F_ICDSP)	;V1.44
;V4.11		@CLB	(F_KON)		;V1.47
;V4.11		@CLB	(F_KOFF)	;V1.47
check_md11:
;V4.11		@BBS	(IO_MT,check_md11)		;if motor moving?  yes ->loop
;V4.11		call	wait_50ms			;
;V4.11		call	vft_disable		;2.01
;V4.11		j	check_md99			; -> for clear RTC display mode
;under OFF condition........
check_md12:
;V4.11		@BBS	(SW_OFF_RT,check_md99)		;under OFF mode(and power sw off)  yes-> ignore other sw update
;wake up(OFF->ON)............
check_md13:
;V4.11		ld	(DELAY_CT),T_NPJG			;set timer for judge OFF -> ON mode
;V4.11		call	wait_xms			;wait a morment(T_NPJG)

;------------------------------------------------
;V4.11		ld	sp,RAM_BOT	;V1.39b	;because this subroutine, only recalled in main routine 
;V4.11		jp	resume		;V1.24
;------------------------------------------------
check_md14:
;V3.00		@BBC	(SW_FIN_RT,check_md15)	;V1.17
;V3.00		@BBS	(M_FINANCE,check_md16)	;V1.20
;V3.00		@SEB	(M_FINANCE)		;V1.17
;V3.00		j	check_md99		;V1.36
check_md15:					;V1.17
;v3.00		@BBC	(M_FINANCE,check_md16)	;V1.20
;V3.00		@CLB	(M_FINANCE)		;V1.19
;V3.00		ld	(FINANCE_0),0	;V1.36
;V3.00		ld	(FINANCE_1),0	;V1.36
;V3.00		j	check_md99		;V1.36
check_md16:					;V1.20
;V3.00		@BBC	(RTC_ON,check_md18_1)	;V1.30
;V3.00		@BBC	(SW_DMY_RT,check_md17)	;V1.21
;V3.00		@BBS	(RTC_DMY,check_md17_1)	;V1.21
;V3.00		@SEB	(RTC_DMY)		;V1.21
;V3.00		call	rtc_edit_d		;RTC data edit and transfer to DISP
;V3.00		call	disp_to_dbr		;DBR update (DISP -> DBR)
;V3.00		jp	check_md39		;V1.21
check_md17:					;V1.21
;V3.00		@BBC	(RTC_DMY,check_md17_1)	;V1.21
;V3.00		@CLB	(RTC_DMY)		;V1.21
;V3.00		call	rtc_edit_d		;RTC data edit and transfer to DISP
;V3.00		call	disp_to_dbr		;DBR update (DISP -> DBR)
;V3.00		jp	check_md39		;V1.21
check_md17_1:					;V1.21
;V3.00		@BBC	(SW_24_RT,check_md18)	;V1.21
;V3.00		@BBS	(RTC_24,check_md18_1)	;V1.21
;V3.00		@SEB	(RTC_24)		;V1.21
;V3.00		call	rtc_edit_d		;RTC data edit and transfer to DISP
;V3.00		call	disp_to_dbr		;DBR update (DISP -> DBR)
;V3.00		jp	check_md39		;V1.21
check_md18:					;V1.21
;V3.00		@BBC	(RTC_24,check_md18_1)	;V1.21
;V3.00		@CLB	(RTC_24)		;V1.21
;V3.00		call	rtc_edit_d		;RTC data edit and transfer to DISP
;V3.00		call	disp_to_dbr		;DBR update (DISP -> DBR)
check_md18_1:					;V1.21
		@BBS	(P_ERR,check_md99)		;printer error occured?  yes-> doesn't check NP, RATE switch 
		@BBS	(P_NP,check_md22)
;under print condition........
		@BBC	(SW_NP_RT,check_md24)
		@SEB	(P_NP)				;get into non print mode
		j	check_md24
;under non print condition........
check_md22:
;V1.32		@BBS	(SW_NP_RT,check_md25)
		@BBS	(SW_NP_RT,check_md24)	;V1.32
		ld	(DELAY_CT),T_NPJG			;set timer for judge NP -> OFF mode
		call	wait_xms			;wait a morment(T_NPJG)
		@CLB	(P_NP)				;release no print mode
;V4.11		@BBS	(SW_OFF_RT,check_md25)
		call	update_md		;V1.30
;V3.01		ld	(SYM),S_SPC	;V1.30
;V3.01		ld	hl,IC_A		;V1.30
;V3.01		call	ic_print	;V1.30
;V3.01		ld	(SYM),S_ST	;V1.03
;V3.01		ld	hl,ACC		;V1.03
;V3.01		call	wk_round	;V1.26
;V3.01		call	wk_print	;V1.03	
;V3.05		@CLB	(F_TNKEY)	;V1.30
;V3.05		@CLB	(F_DPIN)	;V1.30
;V3.05		@CLB	(F_RATE)
;V3.05		@CLB	(EURO_PROG)
;V3.05		@CLB	(RATE_PROG)
;V3.05		@CLB	(F_ICDSP)	;V2.10
;V3.05		@CLB	(IC_PROG)	;V2.10
;V3.05		@CLB	(F_DPIN)
;V3.05		@CLB	(F_MIN_TRA)
;V3.00		@CLB	(RTC_ON)	;V1.52
;V3.00		@CLB	(RTC_CHK)	;V1.52
;V3.00		@CLB	(RTC_SET)	;v1.52
;V3.05		ld	(DT_DOT_CNT),0
;V3.05		ld	(DT_CHR_CNT),0
;V3.05		ld	(TEN_CT),0	;V1.30
;V3.05		ld	(DT_CT),0	;V1.30
;V3.05		ld	(PRE_KEY),0xff	;V1.35
;V3.01		call	acc_to_w2	;V1.17
;V3.01		call	w2_to_ten	;V1.17
;V3.01		ld	hl,TENKEY	;V1.17
;V3.01		call	edit_disp	;V1.17
;V3.01		call	disp_to_dbr	;V1.17
		call	feed_1
		j	check_md99	;V3.05
;V1.35		j	check_md39			;for printer error check
		;-----------------------------------------------
		ld	sp,RAM_BOT	;V1.39b;because this subroutine, only recalled in main routine 
		jp	function_end9	;V1.44
		;-----------------------------------------------
check_md24:
		@BBS	(F_KON,check_md25)	;V1.44
		@BBC	(PAPER_FEED,check_md25)	;V1.44
		@BBS	(SW_FEED_RT,check_md24_1);V1.20V1.39 V1.40
		@BBS	(PAPER_FEED,check_md24_1)	;V1.39
		call	wait_50ms			;V1.39
		@BBC	(PAPER_FEED,check_md25)	;V1.24
check_md24_1:					;V1.24
		call	kfeed_1			;V1.32
;V4.08		@SEB	(F_REVCAN)		;V4.08
;V4.08		call	feed_1			;V4.08
;v3.00		@BBC	(RTC_ON,check_md24_2)	;V1.44;V2.10
;V3.00		@BBS	(RTC_CHK,check_md24_2)	;V2.10
;V3.00		call	rtc_edit_d		;V1.44;V2.10
;V3.00		call	disp_to_dbr		;V1.44;V2.10
check_md24_2:;V2.09
		j	check_md99	;V1.27
check_md25:
		@CLB	(PAPER_FEED)	;V1.44
		@CLB	(SW_FEED)	;V1.44
		@CLB	(SW_FEED_RT)	;V1.44
		@BBC	(F_TNKEY,check_md99)	;V1.27
		@BBC	(DP_UPDATE,check_md99)	;V1.27
		@CLB	(DP_UPDATE)		;V1.27
		jp	check_md99	;V1.19
;exit point of OFF, RATE key are moved.........
check_md33:
		call	error_clr			;clear F_ZDIVER, F_CALER, ICON_E
;V3.00		@CLB	(RTC_ON)			;clear RTC display mode when wakeup
;V3.00		@CLB	(RTC_SET)			;clear RTC set mode when wakeup
		ld	(KEYIN),0			;clear current key code for clear PRE_KEY
		ld	(TEN_CT),0			;V105 for clear tenkey entry status
		ld	(DT_CT),0			;V105 #/D entry counter
		ld	(DT_DOT_CNT),0	;V1.06
		ld	(DT_CHR_CNT),0	;V1.06
		@CLB	(F_DPIN)			;V105 DP entry
		@CLB	(F_MIN_TRA)			;V105 -,M- entry
;		jp	check_md99	;V1.20
;exit point for NP->P(not clear tenkey status.........
check_md39:
;V3.00		@BBS	(RTC_ON,check_md99)	;V1.29
check_md39a:					;V1.36
		set	cf				;C=1: update display and printer error check 
		ret
check_md99:
		clr	cf				;C=0: normal exit
		ret

;===============================================================================
;		check entry key for tax rate set mode
;===============================================================================
check_rtent:
		@BBC	(F_RATE,check_rte91)		;under tax rate set mode?  no->
		ld	b,(KEYIN)
		cmp	b,K_TEN				;if key code is Tenkey,00 or 000?
		j	le,check_rte90			;yes -> through
		cmp	b,K_DP				;DP key?
		j	eq,check_rte90			;yes -> through
		cmp	b,K_CEC				;CE/C key?
		j	eq,check_rte02			;yes -> 
		cmp	b,K_BS				;BS key?
		j	eq,check_rte03			;yes ->
		j	check_rte98			;others are not allowd
;check for CE/C key...
check_rte02:
		@BBS	(F_RTUPD,check_rte03)		;if first time CE/C entery?  no-> 
		ld	(TEN_CT),1			;just store 1 to TEN_CT for it is worked CE function(for avoid Clear function)
		j	check_rte90			; -> allow current key entry
check_rte03:
		cmp	(TEN_CT),0			;with tenkey entry?
		j	ne,check_rte90			;yes -> through
		j	check_rte98			;if no tenkey  -> not allowed

check_rte90:
		@SEB	(F_RTUPD)			;new tax rate entry
check_rte91:
		set	cf				;OK: set CF (means current key allowed)
		ret
check_rte98:
		clr	cf				;NG: clear CF (means current key not allowed) 
		ret

;===============================================================================
;		IO port initialize
;===============================================================================
init_io:		
	ld	(P0CR),0y11111100	;\P00P01 NC, P02:STB2,P03:STB1, P04:LAT, P05P06P07:EEPROM DI/O SK CS
	ld	(P0DR),0y00011100	;/

	ld	(P1DR),0y11111111	;\
	ld	(P1PRD),0y00000000	;|P16:P/H DI, P17:P/H SCK, others key return
	ld	(P1OUTCR),0y11000000	;/
	ld	(TC3SEL),0

	ld	(P2DR),0y00000111	;\P20 PF, P21 Xin, P22 Xout
	ld	(P2PRD),0y00000000	;/

	ld	(P3DR),0y11111111	;\NC
	ld	(P3PRD),0y00000000	

	ld	(P4CR1),0y01111100	;\P40:TM AD, P41:VPR AD
	ld	(P4CR2),0y11111100	;|P42:VPR control, P43:ENA2, P44:ENA1, P45:IN1, P46:IN2 P47:NC
	ld	(P4DR),0y10000000	;/

	ld	(P5DR),0y00000000	;P50~P53 slid return
	ld	(P5CR),0y00000000	;

	ld	(P6DR),0y00000000	;to VFD

	ld	(P7DR),0y00000000	;to VFD

	ld	(P8DR),0y00000000	;to VFD

	ld	(P9DR),0y00000000	;key scan output

	ld	(PDDR),0y00000000	;NC

	ld	(ADCCR1),0y00000000	;\A/D convert disable
	ld	(ADCCR2),0y00000000	;/

	ld	(STOPCR),0y00000000	;no STOP mode will be used
	ret
;===============================================================================
		;----------------------------------------V1.37
rate_init_flag_print:
		call	spc_prnbuf			;V1.37
		ld	ix,PRN_BUF_MSD_LTP			;V1.37
		@IS_LTP_ON(rate_int_print_0)	;V4.03
		ld	ix,PRN_BUF		;V4.03
rate_int_print_0:				;V4.03
		ld	iy,initial_print_work_tbl
	rate_int_print_1:				;V1.37
		ld	a,(iy)
		ld	(ix),a			;V1.37
		inc	ix			;V1.37
		inc	iy
		@IS_LTP_ON(rate_int_print_1x)
		cmp	iy,initial_print_work_tbl_end
		jp	rate_int_print_1y
rate_int_print_1x:					;V4.05
		cmp	iy,initial_print_work_tbl_end_LTP	;V4.05
rate_int_print_1y:
		j	lt,rate_int_print_1		;V1.37
		call	print_bk			;V1.37
		call	feed_1
		;------------------------------------------V1.37
		ret					;V1.39b
initial_print_work_tbl: ;out print: RATE INITIALZED
	db	ps_r,ps_a,ps_t,ps_e,ps_spc,ps_i,ps_n,ps_i,ps_t,ps_i,ps_a,ps_l,ps_i,ps_z,ps_e,ps_d,ps_dot,ps_dot
initial_print_work_tbl_end_LTP:
	db	ps_dot,ps_dot,ps_dot,ps_dot,ps_dot,ps_dot
initial_print_work_tbl_end:
;===============================================================================
obs_key_check:
		cmp	(KEYIN),K_PLS
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_MIN
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_MUL
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_DIV
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_DLT
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_IC
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_PER
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_ST
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_TL
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_MPL
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_MMI
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_MST
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_MTL
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_CST
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_SEL
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_MGR
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_SGN
		j	eq,obs_key_check_cs
		cmp	(KEYIN),K_DP
		j	eq,obs_key_check_cs
		clr	cf
		ret
obs_key_check_cs:
		set	cf
		ret
;===============================================================================
;		Jump address table for each function routin
;===============================================================================
tbl_function:;		key name   for summa20 mode	;table offset  key code
		dw	tenkey		;0-9-000	;+00		00~0b	0 ~ 9, 00,000
		dw	dp_key		;.		;+01		0c	DP
		dw	ce_key		;		;+02		0d	
		dw	cec_key		;C/CE/ON	;+03		0e	CE/C
		dw	gt_key		;		;+04		0f	GT
		dw	acc_plus	;+		;+05		10	+
		dw	acc_minus	;-		;+06		11	-
		dw	acc_subtl	;#/ST/T		;+07		12	S
		dw	acc_total	;		;+08		13	T
		dw	tax2_plus	;		;+09		14	
		dw	tax2_minus	;		;+0a		15
		dw	equal_key	;=		;+0b		16	=
		dw	percent_key	;%/amount key	;+0c		17	%
		dw	multi_key	;X		;+0d		18	x
		dw	divide_key	;/		;+0e		19	Div
		dw	markup_key	;MU/amount	;+0f		1a	MU
		dw	delta_percent	;		;+10		1b	delta%
		dw	sign_change	;		;+11		1c	+/-
		dw	back_space	;		;+12		1d	BS
		dw	sharp_date	;		;+13		1e	#/D
		dw	item_key	;		;+14		1f	
		dw	mem_plus	;M+/payment	;+15		20	M+	
		dw	mem_minus	;m-/month	;+16		21	M-	
		dw	mem_subtl	;MRC/interest	;+17		22	MS	
		dw	mem_total	;Mt/amount	;+18		23	MT	
		dw	cost_key	;		;+19		24	FEED	
		dw	sell_key	;		;+1a		25
		dw	margin_key	;		;+1b		26
		dw	square_root	;square		;+1c		27
		dw	rate_key	;RATE		;+1d		28
		dw	tax_plus	;TAX+		;+1e		29	TAX+
		dw	tax_minus	;TAX-		;+1f		2a	TAX-
		dw	perplus_key	;time_key	;+20		2b	
		dw	euro_key	;EURO/M2+	;+21		2c	COST
		dw	local_key	;LOCAL/M2-	;+22		2d	SELL
		dw	mem2_subtl	;V2.03off_key		;OFF/M2ST	;+23		2e	MARGIN
		dw	mem2_total	;V2.03feed_key	;FED/M2T	;+24		2f
end

⌨️ 快捷键说明

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