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

📄 main.med

📁 calculator code ,use toshibaor nec LSI
💻 MED
📖 第 1 页 / 共 5 页
字号:
     1207       		cmp	(KEYIN),K_PLS
     1208       		j	eq,check_perexe_flag_clearornot_end
     1209       		cmp	(KEYIN),K_MIN
     1210       		j	eq,check_perexe_flag_clearornot_end
     1211       		cmp	(KEYIN),K_MPL
     1212       		j	eq,check_perexe_flag_clearornot_end
     1213       		cmp	(KEYIN),K_MMI
     1214       		j	eq,check_perexe_flag_clearornot_end
     1216 +1    	ld	wa,SW_M2
     1217 +1    	test	(SW_M2>>4).a		;bit -reverse-> jump status
     1218 +1    	j	f,check_perexe_flag_clearornot_8		;if jump status is 0 -> branch
     1220 +1    	ld	wa,F_M2CAL
     1221 +1    	test	(F_M2CAL>>4).a		;bit -reverse-> jump status
     1222 +1    	j	t,check_perexe_flag_clearornot_9		;if jump status is 1 -> branch
     1223       check_perexe_flag_clearornot_8:
     1224       ;V4.12		cmp	(KEYIN),K_M2PL
     1225       ;V4.12		j	eq,check_perexe_flag_clearornot_end
     1226       ;V4.12		cmp	(KEYIN),K_M2MI
     1227       ;V4.12		j	eq,check_perexe_flag_clearornot_end
     1228       check_perexe_flag_clearornot_9:
     1230 +1    	ld	wa,F_PEREXE
     1231 +1    	clr	(F_PEREXE>>4).a
     1232       check_perexe_flag_clearornot_end:
     1233       		ret
     1234       ;===============================================================================
     1235       ;		System error
     1236       ;===============================================================================
     1237       sys_error:
     1238       ;V1.09		@BBS	(ERR_MES,function_end9)		;already print error message  yes-> skip print
     1240 +1    	ld	wa,ICON_E
     1241 +1    	set	(ICON_E>>4).a
     1243 +1    	ld	wa,P_ERR
     1244 +1    	test	(P_ERR>>4).a		;bit -reverse-> jump status
     1245 +1    	j	f,sys_errpe1		;if jump status is 0 -> branch
     1246       		call	err_print
     1247       		ld	hl,W1
     1248       		call	wk_print
     1249       		call	w1_to_ten
     1250       sys_errpe:
     1251       		call	feed_1
     1252       sys_errpe1:				;V1.39a
     1253       ;V3.00		call	ten_clear			;display '0'
     1254       		cmp	(KEYIN),K_PERPLS
     1255       		j	ne,sys_errpe2
     1256       		ld	hl,IC_A
     1257       		ld	(SYM),S_SPC		;V1.24
     1258       		call	ic_print
     1259       		call	acc_to_ten
     1260       		ld	hl,TENKEY
     1261       		ld	(SYM),S_ST
     1262       		call	wk_print
     1263       		call	feed_1
     1264       sys_errpe2:
     1265       		j	function_end9
     1266       
     1267       ;===============================================================================
     1268       ;		Error recovery
     1269       ;===============================================================================
     1270       error_recov:
     1271       		cmp	(KEYIN),K_BS
     1272       		j	ne,error_recov_x	;V4.07
     1273       ;V4.12		@BBS	(F_COUNTRY,error_bs)	;V4.12
     1274       ;V4.12		@BBS	(F_RATE,no_operation)	;V4.07
     1276 +1    	ld	wa,F_RATE
     1277 +1    	test	(F_RATE>>4).a		;bit -reverse-> jump status
     1278 +1    	j	f,error_rec_bs		;if jump status is 0 -> branch
     1279       		ld	(PRE_KEY),0xff	;V4.12
     1280       		j	error_rcv3	;V4.12
     1281       ;V4.12		jp	error_bs_1		;V4.12
     1282       error_rec_bs:					;v4.12
     1284 +1    	ld	wa,EURO_PROG
     1285 +1    	test	(EURO_PROG>>4).a		;bit -reverse-> jump status
     1286 +1    	j	t,error_bs		;if jump status is 1 -> branch
     1287       		jp	no_operation		;V4.12
     1288       error_bs:					;V4.12
     1289       		cmp	(PRE_KEY),K_RATE	;V4.17
     1290       		j	eq,error_bs_0		;V4.17
     1291       		cmp	(PRE_KEY),K_EQU	;V4.12
     1292       		j	eq,error_bs_0	;V4.12
     1293       		cmp	(PRE_KEY),K_EURO	;V4.12a
     1294       		j	eq,error_bs_0		;V4.12a
     1295       		cmp	(PRE_KEY),K_LOCAL	;V4.12a
     1296       		j	eq,error_bs_0		;V4.12a
     1298 +1    	ld	wa,F_COUNTRY
     1299 +1    	test	(F_COUNTRY>>4).a		;bit -reverse-> jump status
     1300 +1    	j	f,error_bs_0		;if jump status is 0 -> branch
     1301       		CMP	(COUNTRY_TEN),17	;V4.12
     1302       		j	ge,no_operation	;V4.12	;V4.12
     1304 +1    	ld	wa,F_TNKEY
     1305 +1    	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
     1306 +1    	j	t,error_bs_0		;if jump status is 1 -> branch
     1307       		cmp	(COUNTRY_TEN),12	;V4.12
     1308       		j	lt,no_operation		;V4.12
     1309       error_bs_0:					;V4.12
     1311 +1    	ld	wa,F_RATE
     1312 +1    	clr	(F_RATE>>4).a
     1313       error_bs_1:					;V4.12
     1315 +1    	ld	wa,F_COUNTRY
     1316 +1    	clr	(F_COUNTRY>>4).a
     1317       		call	error_clr		;V4.10
     1319 +1    	ld	wa,F_TNKEY
     1320 +1    	test	(F_TNKEY>>4).a		;bit -reverse-> jump status
     1321 +1    	j	f,error_bs_2		;if jump status is 0 -> branch
     1322       		call	ten_clear		;V4.12
     1323       error_bs_2:					;V4.12
     1325 +1    	ld	wa,F_TNKEY
     1326 +1    	clr	(F_TNKEY>>4).a
     1328 +1    	ld	wa,F_DPIN
     1329 +1    	clr	(F_DPIN>>4).a
     1331 +1    	ld	wa,F_MIN_TRA
     1332 +1    	clr	(F_MIN_TRA>>4).a
     1334 +1    	ld	wa,EURO_DISPLY
     1335 +1    	set	(EURO_DISPLY>>4).a
     1336       		ld	(TEN_CT),0		;V4.10
     1337       		ld	(DT_CT),0		;V4.10
     1338       		ld	(DT_DOT_CNT),0		;V4.10
     1339       		ld	(DT_CHR_CNT),0		;V4.10
     1340       
     1341       		j	function_end99		;V4.10
     1342       ;V4.10		j	error_rcv3
     1343       error_recov_x:
     1344       		cmp	(KEYIN),K_CE		;V1.24;-> recovery (clear 'E' icon only)
     1345       		j	eq,error_rcv2		;V1.24
     1346       		cmp	(KEYIN),K_CEC
     1347       		j	eq,error_rcv1		;-> recovery (clear 'E' display '0')
     1348       		j	no_operation
     1349       ;CEC key.......
     1350       error_rcv1:
     1352 +1    	ld	wa,P_ERR
     1353 +1    	test	(P_ERR>>4).a		;bit -reverse-> jump status
     1354 +1    	j	f,error_rcv10		;if jump status is 0 -> branch
     1356 +1    	ld	wa,SW_AC
     1357 +1    	test	(SW_AC>>4).a		;bit -reverse-> jump status
     1358 +1    	j	t,error_rcv2		;if jump status is 1 -> branch
     1359       error_rcv10:
     1360       		ld	(FLG_E),0		;V1.13
     1361       		ld	(FLG_C),0		;V1.13
     1363 +1    	ld	wa,P_ERR
     1364 +1    	test	(P_ERR>>4).a		;bit -reverse-> jump status
     1365 +1    	j	f,error_rcvpe		;if jump status is 0 -> branch
     1366       		call	error_clr		;clear F_ZDIVER, F_CALER, ICON_E
     1367       		j	cec_key
     1368       ;V4.12		@CLB	(MEQ_ENB)		;not allow M+= or M-= calculation even having multi/div entry before
     1369       error_rcv2:
     1371 +1    	ld	wa,F_COUNTRY
     1372 +1    	clr	(F_COUNTRY>>4).a
     1374 +1            test	(FLG_MODE).2
     1375 +1    	j	t,error_rcv2_1
     1376       		and	(FLG_E),0x0f		;V4.12
     1377       		and	(FLG_C),0x0f		;V4.12
     1378       error_rcv2_1:					;V4.12
     1379       ;V3.04		ld	(FLG_E),0		;V1.32
     1380       ;V3.04		ld	(FLG_C),0		;V1.32
     1382 +1    	ld	wa,P_ERR
     1383 +1    	test	(P_ERR>>4).a		;bit -reverse-> jump status
     1384 +1    	j	f,no_operation		;if jump status is 0 -> branch
     1385       		call	ten_clear		;V1.30
     1386       ;V1.30		@SEB	(ERR_CLR)		;set just after clear calculation error flag for chain multi/div function
     1387       error_rcv3:
     1388       		call	error_clr		;V1.30
     1389       error_rcv29:
     1390       		j	function_end		;
     1391       
     1392       error_rcvpe:
     1393       		call	all_clear		;h/w initialize, work area clear, interrupt enable
     1395 +1    	ld	wa,ICON_E
     1396 +1    	clr	(ICON_E>>4).a
     1398 +1    	ld	wa,P_ERR
     1399 +1    	clr	(P_ERR>>4).a
     1401 +1    	ld	wa,F_COUNTRY
     1402 +1    	clr	(F_COUNTRY>>4).a
     1403       		call	error_clr		;V1.37
     1404       		call	spc_prnbuf		;V1.37
     1405       		ld	(PRN_BUF_LSD-1),ps_0	;v4.03
     1406       		ld	(PRN_BUF_LSD),ps_dot	;V4.03 "0." print out	V1.37
     1407       		ld	(PRN_BUF_SYM),S_CLR	;V4.03 'C ';V1.37
     1408       
     1410 +1    	test	(FLG_MODE).0
     1411 +1    	j	t,error_rcvpe_1
     1412       		ld	(PRN_BUF_LSD_LTP-1),ps_0	;V4.03
     1413       		ld	(PRN_BUF_LSD_LTP),ps_dot	;V4.03 "0." print out
     1414       		ld	(PRN_BUF_SYM_LTP),S_CLR		;V4.03 'C ';V1.37
     1415       error_rcvpe_1:						;V4.03
     1416       
     1417       		call	print_bk		;V1.37
     1418       
     1419       ;V1.37		call	wkup_print		;V1.09 initial print
     1420       		call	feed_1			;V1.31
     1421       ;V1.09		call	prn_init		;printer initialize
     1422       		j	error_rcv29
     1423       
     1424       
     1425       ;clear all error flags.......
     1426       error_clr:
     1428 +1    	ld	wa,F_ZDIVER
     1429 +1    	clr	(F_ZDIVER>>4).a
     1431 +1    	ld	wa,F_CALER
     1432 +1    	clr	(F_CALER>>4).a
     1434 +1    	ld	wa,ICON_E
     1435 +1    	clr	(ICON_E>>4).a
     1436       		ret
     1437       ;===============================================================================
     1438       ;		Check mode key (ON-OFF,RATE-OFF,NP-PRN)
     1439       ;===============================================================================
     1440       T_NPJG		equ	30				;7813us x 30 = 234.4ms (the value for judge NP -> P)
     1441       ;T_NPJG		equ	20				;7813us x 20 = 156.3ms (the value for judge NP -> P)
     1442       
     1443       check_mdsw:
     1444       ;V4.11		@BBS	(F_OFF,check_md12)
     1445       ;under ON condition........
     1446       ;V4.11		@BBC	(SW_OFF_RT,check_md14)		;power sw move to OFF? no->
     1447       ;V4.11		cmp	(KEY_CT),0			;KEY_CT=0?
     1448       ;V4.11		j	ne,check_md14			;no -> not allow to enter OFF mode
     1449       ;get into OFF mode(ON->OFF).....
     1450       ;V4.11		@SEB	(F_OFF)				;
     1451       ;V4.11		@SEB	(F_DOFF)	;V2.05
     1452       ;V4.11		@CLB	(IC_PROG)	;
     1453       ;V3.00		@CLB	(RTC_ON)	;V1.44
     1454       ;V3.00		@CLB	(RTC_SET)	;V1.44
     1455       ;V3.00		@CLB	(RTC_CHK)	;V2.12
     1456       ;V4.11		@CLB	(F_ICDSP)	;V1.44
     1457       ;V4.11		@CLB	(F_KON)		;V1.47
     1458       ;V4.11		@CLB	(F_KOFF)	;V1.47
     1459       check_md11:
     1460       ;V4.11		@BBS	(IO_MT,check_md11)		;if motor moving?  yes ->loop
     1461       ;V4.11		call	wait_50ms			;
     1462       ;V4.11		call	vft_disable		;2.01
     1463       ;V4.11		j	check_md99			; -> for clear RTC display mode
     1464       ;under OFF condition........
     1465       check_md12:
     1466       ;V4.11		@BBS	(SW_OFF_RT,check_md99)		;under OFF mode(and power sw off)  yes-> ignore other sw update
     1467       ;wake up(OFF->ON)............
     1468       check_md13:
     1469       ;V4.11		ld	(DELAY_CT),T_NPJG			;set timer for judge OFF -> ON mode
     1470       ;V4.11		call	wait_xms			;wait a morment(T_NPJG)
     1471       
     1472       ;------------------------------------------------
     1473       ;V4.11		ld	sp,RAM_BOT	;V1.39b	;because this subroutine, only recalled in main routine 
     1474       ;V4.11		jp	resume		;V1.24
     1475       ;------------------------------------------------
     1476       check_md14:
     1477       ;V3.00		@BBC	(SW_FIN_RT,check_md15)	;V1.17
     1478       ;V3.00		@BBS	(M_FINANCE,check_md16)	;V1.20
     1479       ;V3.00		@SEB	(M_FINANCE)		;V1.17
     1480       ;V3.00		j	check_md99		;V1.36
     1481       check_md15:					;V1.17
     1482       ;v3.00		@BBC	(M_FINANCE,check_md16)	;V1.20
     1483       ;V3.00		@CLB	(M_FINANCE)		;V1.19
     1484       ;V3.00		ld	(FINANCE_0),0	;V1.36
     1485       ;V3.00		ld	(FINANCE_1),0	;V1.36
     1486       ;V3.00		j	check_md99		;V1.36
     1487       check_md16:					;V1.20
     1488       ;V3.00		@BBC	(RTC_ON,check_md18_1)	;V1.30
     1489       ;V3.00		@BBC	(SW_DMY_RT,check_md17)	;V1.21
     1490       ;V3.00		@BBS	(RTC_DMY,check_md17_1)	;V1.21
     1491       ;V3.00		@SEB	(RTC_DMY)		;V1.21
     1492       ;V3.00		call	rtc_edit_d		;RTC data edit and transfer to DISP
     1493       ;V3.00		call	disp_to_dbr		;DBR update (DISP -> DBR)
     1494       ;V3.00		jp	check_md39		;V1.21
     1495       check_md17:					;V1.21
     1496       ;V3.00		@BBC	(RTC_DMY,check_md17_1)	;V1.21
     1497       ;V3.00		@CLB	(RTC_DMY)		;V1.21
     1498       ;V3.00		call	rtc_edit_d		;RTC data edit and transfer to DISP
     1499       ;V3.00		call	disp_to_dbr		;DBR update (DISP -> DBR)
     1500       ;V3.00		jp	check_md39		;V1.21
     1501       check_md17_1:					;V1

⌨️ 快捷键说明

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