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

📄 business_fn.med

📁 calculator code ,use toshibaor nec LSI
💻 MED
📖 第 1 页 / 共 5 页
字号:
      962       		call	edit_disp
      963       rate_key_end_99:
      964       		ld	(DISP+2),D_S
      965       		ld	(DISP+3),D_E
      966       		ld	(DISP+4),D_T
      967       		call	disp_to_dbr
      968       rate_key_end:
      969       ;V3.01		jp	function_end
      970       		jp	no_operation	;V3.01
      971       ;=============================================================================
      972       keep_ten_6dig:
      973       	ld	(TEN_CT),14
      974       	ld	c,1
      975       	ld	hl,TENKEY
      976       keep_ten_6dig_x:
      977       	ld	a,(hl+c)
      978       	and	a,0xf0
      979       	j	ne,keep_ten_6dig_0
      980       	dec	(TEN_CT)
      981       	ld	a,(hl+OFF_DP)
      982       	cmp	a,(TEN_CT)
      983       	j	ge,keep_ten_6dig_0
      984       	ld	a,(hl+c)
      985       	and	a,0x0f
      986       	j	ne,keep_ten_6dig_0
      987       	dec	(TEN_CT)
      988       	ld	a,(hl+OFF_DP)
      989       	cmp	a,(TEN_CT)
      990       	j	ge,keep_ten_6dig_0
      991       	inc	c
      992       	cmp	c,8
      993       	j	ge,keep_ten_6dig_0
      994       	jp	keep_ten_6dig_x
      995       keep_ten_6dig_0:
      996       	cmp	(TEN_CT),6
      997       	j	lt,to_inc_ten_digit
      998       to_dec_ten_digit:
      999       	cmp	(TEN_CT),7
     1000       	j	lt,keep_ten_6dig_end
     1001       	j	gt,to_dec_ten_digit_1
     1002       	cmp	(TEN_DP),6
     1003       	j	ne,to_dec_ten_digit_1
     1004       	ld	hl,TENKEY+1
     1005       	call	test_zero_before_dp
     1006       	j	cc,keep_ten_6dig_end
     1007       to_dec_ten_digit_1:
     1008       	ld	hl,TENKEY
     1009       	call	stg_sfr47
     1010       	dec	(TENKEY+8)
     1011       	dec	(TEN_CT)
     1012       	j	gt,to_dec_ten_digit
     1013       	
     1014       to_inc_ten_digit:
     1015       	cmp	(TEN_CT),6
     1016       	j	ge,keep_ten_6dig_end
     1017       	ld	hl,TENKEY
     1018       	call	stg_sfl47
     1019       	inc	(TENKEY+8)
     1020       	inc	(TEN_CT)
     1021       	j	to_inc_ten_digit
     1022       
     1023       keep_ten_6dig_end:
     1024       	ret
     1025       ;-----------------------------------------
     1026       test_zero_before_dp:
     1027       	ld	c,0
     1028       	ld	w,14
     1029       test_zero_before_dp_s:
     1030       	ld	a,(hl+c)
     1031       	and	a,0xf0
     1032       	j	ne,test_zero_before_dp_1
     1033       	dec	w
     1034       	cmp	w,(hl+OFF_DP-1)
     1035       	j	eq,test_zero_before_dp_0
     1036       	ld	a,(hl+c)
     1037       	and	a,0x0f
     1038       	j	ne,test_zero_before_dp_1
     1039       	dec	w
     1040       	cmp	w,(hl+OFF_DP-1)
     1041       	j	eq,test_zero_before_dp_0
     1042       	inc	c
     1043       	jp	test_zero_before_dp_s
     1044       test_zero_before_dp_0:
     1045       	clr	cf
     1046       	ret
     1047       test_zero_before_dp_1:
     1048       	set	cf
     1049       	ret
     1050       ;-----------------------------------------
     1051       ;V2.08
     1052       check_dp_over_slid:
     1053       	ld	a,(hl+OFF_DP)
     1054       	cmp	a,(DP_POS)
     1055       check_dp_over_slid_0:
     1056       	j	ge,check_dp_over_slid_end
     1057       	ld	d,(hl+OFF_MSD)
     1059 +1    	ld	wa,M14
     1060 +1    	test	(M14>>4).a		;bit -reverse-> jump status
     1061 +1    	j	f,check_dp_over_slid_1		;if jump status is 0 -> branch
     1062       	ld	d,(hl+OFF_MSD12)	;V1.21
     1064 +1    	ld	wa,M10
     1065 +1    	test	(M10>>4).a		;bit -reverse-> jump status
     1066 +1    	j	t,check_dp_over_slid_1		;if jump status is 1 -> branch
     1067       	ld	d,(hl+OFF_MSD10)	;V1.21
     1068       check_dp_over_slid_1:			;V1.21
     1069       	and	d,0xf0
     1070       	j	nz,check_dp_over_slid_end
     1071       	inc	(hl+OFF_DP)
     1072       	call	stg_sfl47
     1073       	jp	check_dp_over_slid
     1074       check_dp_over_slid_end:
     1075       	ret
     1076       ;V2.08
     1077       ;=================================
     1078       check_dp_over2:
     1079       	cmp	(hl+OFF_DP),2
     1080       check_dp_over2_0:
     1081       	j	ge,check_dp_over2_end
     1082       	ld	d,(hl+OFF_MSD)
     1084 +1    	ld	wa,M14
     1085 +1    	test	(M14>>4).a		;bit -reverse-> jump status
     1086 +1    	j	f,check_dp_over2_1		;if jump status is 0 -> branch
     1087       	ld	d,(hl+OFF_MSD12)	;V1.21
     1089 +1    	ld	wa,M10
     1090 +1    	test	(M10>>4).a		;bit -reverse-> jump status
     1091 +1    	j	t,check_dp_over2_1		;if jump status is 1 -> branch
     1092       	ld	d,(hl+OFF_MSD10)	;V1.21
     1093       check_dp_over2_1:			;V1.21
     1094       	and	d,0xf0
     1095       	j	nz,check_dp_over2_end
     1096       	inc	(hl+OFF_DP)
     1097       	call	stg_sfl47
     1098       	jp	check_dp_over2
     1099       check_dp_over2_end:
     1100       	ret
     1101       
     1102       keep_2dp:
     1103       	ld	a,(DP_POS)
     1104       	push	a
     1105       	ld	(DP_POS),2
     1106       	call	wk_round_0
     1107       	pop	a
     1108       	ld	(DP_POS),a
     1109       	ret
     1110       
     1111       ;V2.06-----------------------------
     1112       fix_round_down_keep_2dp:
     1113       	ld	a,(MDFLG_1)	;V2.06	keep round flag
     1114       	push	a		;v2.06
     1116 +1    	ld	wa,SW_RNDUP
     1117 +1    	clr	(SW_RNDUP>>4).a
     1119 +1    	ld	wa,SW_RND54
     1120 +1    	clr	(SW_RND54>>4).a
     1121       	call	keep_2dp
     1122       	pop	a		;V2.06	
     1123       	ld	(MDFLG_1),a	;V2.06	restore round flag 
     1124       	ret
     1125       
     1126       fix_round_up_keep_2dp:
     1127       	ld	a,(MDFLG_1)	;V2.06	keep round flag
     1128       	push	a		;v2.06
     1130 +1    	ld	wa,SW_RNDUP
     1131 +1    	set	(SW_RNDUP>>4).a
     1133 +1    	ld	wa,SW_RND54
     1134 +1    	clr	(SW_RND54>>4).a
     1135       	call	keep_2dp
     1136       	pop	a		;V2.06	
     1137       	ld	(MDFLG_1),a	;V2.06	restore round flag 
     1138       	ret
     1139       ;V2.06---------------------------------------
     1140       tax_mark_print:
     1141       ;V3.00		@BBS	(SW_V15,tax_mark_print_0)	;V2.07
     1142       		ret					;V2.07
     1143       ;V3.00tax_mark_print_0:					;V2.07
     1144       ;V3.00		call	spc_prnbuf
     1145       ;V3.00		ld	hl,PRN_BUF
     1146       ;V3.00		ld	a,0xcc
     1147       ;V3.00		ld	c,7
     1148       ;V3.00	whic_tax_print_1:				
     1149       ;V3.00		ld	(hl+c),a			
     1150       ;V3.00		dec	c			
     1151       ;V3.00		cmp	c,3
     1152       ;V3.00		j	f,whic_tax_print_1
     1153       ;V3.00		ld	a,0xfc			;only"." at right side 
     1154       ;V3.00		ld	(hl+c),a
     1155       ;V3.00		ld	(PRN_BUF_SYM),S_SPC
     1156       ;V3.00		ld	(PRN_BUF+5),0xc1	;for set_tax1_mark_print:
     1157       ;V3.00		@BBC	(M_TX2,whic_tax_print_end)
     1158       ;V3.00		@BBC	(M_TX1,to_tax2_mark_print)	;V2.07
     1159       ;V3.00		ld	(PRN_BUF+5),0x1b		;V2.07	'1,'
     1160       ;V3.00		ld	(PRN_BUF+6),0x2c		;V2.07	'2.'
     1161       ;V3.00		jp	whic_tax_print_end		;V2.07
     1162       ;V3.00to_tax2_mark_print:					;V2.07
     1163       ;V3.00		ld	(PRN_BUF+5),0xc2	;for set_tax2_mark_print:
     1164       ;V3.00whic_tax_print_end:
     1165       ;V3.00		call	print_bk
     1166       ;V3.00		ret
     1167       ;----------------------------------------------------V2.06
     1168       ;===============================================================================
     1169       tax2_plus:
     1170       ;V4.11		@SEB	(M_TX2)
     1171       ;V3.00		@BBC	(SW_V15,tax2_plus_x)	;v1.19\
     1172       ;V3.00		ld	(KEYIN),K_TAX		;V1.19|wait for acc_plus or acc_minus
     1173       ;V3.00		@BBS	(F_RATE,tax_plus_0)	;V1.20
     1174       ;V3.00		jp	tax_min91		;V1.19/    
     1175       tax2_plus_x:					;V1.19
     1176       		jp	tax_plus_a	;V1.17
     1177       ;===============================================================================
     1178       ;		TAX+
     1179       ;===============================================================================
     1180       tax_plus:
     1181       ;V3.00		@BBC	(SW_V15,tax_plus_x)	;V1.19\		
     1182       ;V3.00		@SEB	(M_TX1)			;V2.07|
     1183       ;V3.00		ld	(KEYIN),K_TAX		;V1.19|will wait for [+] or [-] to perform [TAX+] or [TAX-]
     1184       ;V3.00		@BBS	(F_RATE,tax_plus_0)	;V1.20|--> is recall or set rate?
     1185       ;V3.00		jp	tax_min91		;V1.19/
     1186       ;V4.17		@IS_5514_OFF(tax_plus_x)	;V4.12
     1188 +1            test	(FLG_MODE).2
     1189 +1    	j	f,tax_plus_x
     1191 +1    	ld	wa,F_TNKEY
     1192 +1    	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
     1193 +1    	j	f,tax_plus_x		;if jump status is 0 -> branch
     1194       		ld	a,(FLG_E)	;V4.12
     1195       		and	a,0y00000011	;V4.12
     1196       		j	ne,no_operation	;V4.12
     1197       tax_plus_x:
     1199 +1    	ld	wa,F_REVCAN
     1200 +1    	set	(F_REVCAN>>4).a
     1202 +1    	ld	wa,SW_EUTX
     1203 +1    	test	(SW_EUTX>>4).a		;bit -reverse-> jump status
     1204 +1    	j	t,tax_plus_a		;if jump status is 1 -> branch
     1205       		ld	(KEYIN),K_EURO		;need to perform euro logic?
     1206       		jp	euro_key_start		
     1207       tax_plus_a:				
     1209 +1    	ld	wa,F_RATE
     1210 +1    	test	(F_RATE>>4).a		;bit -reverse-> jump status
     1211 +1    	j	f,tax_plus_0		;if jump status is 0 -> branch
     1212       tax_plus_y:					;V1.09\
     1213       		call	tax_equ
     1215 +1    	ld	wa,F_CALER
     1216 +1    	test	(F_CALER>>4).a		;bit -reverse-> jump status
     1217 +1    	j	f,tax_equ_end		;if jump status is 0 -> branch
     1218       		j	cs,no_operation
     1219       		call	ten_to_w2dp		;V1.15|ten buffer write into W2
     1220       		cmp	(PRE_KEY),K_TXM		;V1.15\
     1221       		j	eq,tax_min00		;V1.15/yes, jump to-->
     1222       		jp	tax_minus_yuan		
     1223       ;=================================================================================
     1224       ;rate setting or rate recall
     1225       tax_plus_0:
     1227 +1            test	(FLG_MODE).2
     1228 +1    	j	f,tax_plus_0x
     1230 +1    	ld	wa,EURO_PROG
     1231 +1    	test	(EURO_PROG>>4).a		;bit -reverse-> jump status
     1232 +1    	j	f,tax_plus_01		;if jump status is 0 -> branch
     1233       tax_plus_0x:					;V4.12
     1235 +1    	ld	wa,F_TNKEY
     1236 +1    	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
     1237 +1    	j	t,tax_plus_01		;if jump status is 1 -> branch
     1238       		ld	(KEYIN),0xff		;V1.13| is rate setting?
     1239       		jp	tax_plus_1		;V1.13/
     1240       tax_plus_01:					;V1.13
     1241       		call	tax_recall
     1242       		jp	tax_plus_2
     1243       tax_plus_1:	;------------------------------------------tax rate set
     1244       		call	tax_save
     1245       tax_plus_2:
     1247 +1    	ld	wa,RATE_PROG
     1248 +1    	clr	(RATE_PROG>>4).a
     1250 +1    	ld	wa,EURO_PROG
     1251 +1    	clr	(EURO_PROG>>4).a
     1253 +1    	ld	wa,F_RATE
     1254 +1    	clr	(F_RATE>>4).a
     1256 +1    	ld	wa,F_TNKEY
     1257 +1    	clr	(F_TNKEY>>4).a
     1259 +1    	ld	wa,F_DPIN
     1260 +1    	clr	(F_DPIN>>4).a
     1261       		ld	(TEN_CT),0	;
     1262       		ld	(DT_CT),0	;
     1263       		ld	(DT_DOT_CNT),0	;
     1264       		ld	(DT_CHR_CNT),0	;

⌨️ 快捷键说明

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