📄 eeprom.med
字号:
1249 ;====================================================================
1250 ; write 8byte data into EEPROM
1251 ;====================================================================
1252 wkreg_to_ee:
1254 +1 ld wa,EP_FAIL
1255 +1 test (EP_FAIL>>4).a ;bit -reverse-> jump status
1256 +1 j t,wkreg_to_ee0 ;if jump status is 1 -> branch
1257 ret
1258 wkreg_to_ee0:
1259 call ee_enable
1260 ld e,4 ;4 word write
1261 wkreg_to_ee1:
1262 push e
1263 ld bc,(hl)
1264 ld a,b ;exchange b and c
1265 ld b,c ;
1266 ld c,a ;
1267 call ee_write
1268 inc (EP_ADDR)
1269 inc hl ;point to next two data
1270 inc hl ;
1271 pop e
1272 dec e
1273 j ne,wkreg_to_ee1
1274 call ee_disable
1275 ret
1276
1277 ;====================================================================
1278 ee_rate_init:
1279 call ee_enable
1280 ld bc,(check_code)
1281 ld (EP_ADDR),EE_TEST1
1282 call ee_write
1284 +1 ld wa,EP_FAIL
1285 +1 test (EP_FAIL>>4).a ;bit -reverse-> jump status
1286 +1 j t,ee_rate_i0a ;if jump status is 1 -> branch
1287 ret
1288 ee_rate_i0a:
1289 ld (EP_ADDR),EE_TEST2
1290 call ee_write
1291
1292 ld (EP_ADDR),EE_EU1
1293 ld d,RATE_L
1294 ld e,15
1295 mul d,e ;e=15 x RATE_L
1296 ld hl,ini_rate_tbl
1297 ld d,0
1298 ee_rate_i00:
1299 push de
1300 ld c,d
1301 ld de,(hl+c)
1302 ld bc,de
1303 ld a,c ;\
1304 ld c,b ;|exchange b and c
1305 ld b,a ;/
1306 call ee_write
1307 inc (EP_ADDR)
1308 pop de
1309 inc d ;
1310 inc d ;
1311 dec e
1312 j nz,ee_rate_i00
1313
1314
1315 ld (COUNTRY),0 ;
1316 ld c,(COUNTRY) ;COUNTRY=00 Country code
1317 ; ld b,(SYS_FUNC) ;
1318 ld (EP_ADDR),EE_COUNTRY
1319 call ee_write
1320 call ee_disable
1321 ret
1322 ;--------------------------------------------------------V2.04
1323 country_tbl:
1324 db 0,1,2,3,4,5,6,7,8,9,0,0,10
1325 ;=========================================
1326 rate_init_check: ;[0]+[+] to display "r-CC" for hand mode, [C]+[+] for desk mode
1327 di
1328 ld (P9DR),0y10000000 ;\'[C]' key out put.
1329
1330 call ee_wait_10_nop
1331 call ee_wait_10_nop ;V3.12
1332 call ee_wait_10_nop ;V3.12
1333 call ee_wait_10_nop ;V3.12
1334 call ee_wait_10_nop ;v3.12
1335
1336 ld a,(P1PRD) ;\
1337 and a,0y00111111 ;|
1338 cmp a,0y00001000 ;|"C" key?
1339 j ne,rate_ini9 ;|
1340 call ee_wait_10_nop ;/
1341
1342 ld a,(P1PRD) ;\
1343 and a,0y00111111 ;|
1344 cmp a,0y00001000 ;|
1345 j ne,rate_ini9 ;/
1346 ;------------------------------------------
1347 ld (P9DR),0y00000010 ;\'[RATE]' key out put
1348
1349 call ee_wait_10_nop
1350 call ee_wait_10_nop ;V3.12
1351 call ee_wait_10_nop ;V3.12
1352 call ee_wait_10_nop ;V3.12
1353 call ee_wait_10_nop ;v3.12
1354
1355 ld a,(P1PRD) ;\
1356 and a,0y00111111 ;|
1357 cmp a,0y00000001 ;|
1358 j ne,rate_ini9 ;|
1359 call ee_wait_10_nop ;/
1360
1361 ld a,(P1PRD) ;\
1362 and a,0y00111111 ;|
1363 cmp a,0y00000001 ;|
1364 j ne,rate_ini9 ;/
1365 ;------------------------------------------
1367 +1 ld wa,RATE_INI
1368 +1 set (RATE_INI>>4).a
1369 ei
1370 ret
1371 rate_ini9:
1373 +1 ld wa,RATE_INI
1374 +1 clr (RATE_INI>>4).a
1375 ei
1376 ret
1377 ;================================================V1.34
1378 ee_wait_10_nop: ;10 x 2 =10 cycles 10x0.5us=5us
1379 nop
1380 nop
1381 nop
1382 nop
1383 nop
1384 nop
1385 nop
1386 nop
1387 nop
1388 nop
1389 ret
1390 ;==============================================================================
1391 country_to_ee:
1393 +1 ld wa,EP_FAIL
1394 +1 test (EP_FAIL>>4).a ;bit -reverse-> jump status
1395 +1 j f,country_to_ee9 ;if jump status is 0 -> branch
1396 ld bc,(COUNTRY);Country code
1397 ld (EP_ADDR),EE_COUNTRY
1398 call ee_enable
1399 call ee_write
1400 call ee_disable
1401 country_to_ee9:
1402 ret
1403 ;==============================================================================
1404 ee_country_read:
1405 ld bc,0
1407 +1 ld wa,EP_FAIL
1408 +1 test (EP_FAIL>>4).a ;bit -reverse-> jump status
1409 +1 j f,ee_country_8 ;if jump status is 0 -> branch
1410 ld (EP_ADDR),EE_COUNTRY
1411 call ee_read ;<--country code in register c
1412 cmp c,17
1413 j lt,ee_country_9
1414 ee_country_8:
1415 ld c,0
1416 ee_country_9:
1417 cmp b,17
1418 j lt,ee_country_10
1419 ld b,0
1420 ee_country_10:
1421 ld (COUNTRY),bc
1422 ret
1423 ;==============================================================================
1424 ;initial value for euro is 1.00, for tax rate is 0.00
1425 ;==============================================================================
1426 euro_fix_rate_tbl:
1427 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country1 00,EUr euro
1428 db 0x00,0x00,0x00,0x00,0x40,0x33,0x99,0x04 ;country2 01 bEF belgian Franc
1429 db 0x00,0x00,0x00,0x00,0x19,0x55,0x83,0x05 ;country3 02 dEN Deutche Marks
1430 db 0x00,0x00,0x00,0x00,0x16,0x63,0x86,0x03 ;country4 03 ESP Espania Pesetas
1431 db 0x00,0x00,0x00,0x00,0x65,0x59,0x57,0x05 ;country5 04 FrF French Francs
1432 db 0x00,0x00,0x00,0x00,0x78,0x75,0x64,0x06 ;country6 05 IEP Ireland Pounds
1433 db 0x00,0x00,0x00,0x00,0x19,0x36,0x27,0x02 ;country7 06 ItL Italian Lires
1434 db 0x00,0x00,0x00,0x00,0x40,0x33,0x99,0x04 ;country8 07 LUF Luxembourg Francs
1435 db 0x00,0x00,0x00,0x00,0x22,0x03,0x71,0x05 ;country9 08 nLG Nederland Guiders
1436 db 0x00,0x00,0x00,0x00,0x13,0x76,0x03,0x04 ;country10 09 AtS Austrian Schillings
1437 db 0x00,0x00,0x00,0x00,0x20,0x04,0x82,0x03 ;country11 10 PtE Portuguese Escudos
1438 db 0x00,0x00,0x00,0x00,0x59,0x45,0x73,0x05 ;country12 11 FIN Finnish Markkas
1439 ini_rate_tbl:
1440 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country13 12 CC1
1441 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country14 13 CC2
1442 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country15 14 CC3
1443 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country16 15 CC4
1444 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country17 16 CC5
1445 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country18 17 CC6
1446 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country19 18 CC7
1447 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country20 19 CC8
1448 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country21 20 CC9
1449 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country22 21 CC10
1450 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country23 22 CC11
1451 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country24 23 CC12
1452 db 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x05 ;country25 24 CC13
1453 db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06 ;TAX
1454 db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06 ;TAX2
1455 check_code:
1456 db 0x55,0xaa
1457
1458
1459 end
Toshiba Unified Macro processor (32) V1.0o [Page 2]
Cross reference & Symbol table listing
--------------------------------------
Name Type Value Reference
ACCES_OFF MAC
ACCES_ON MAC
BBC MAC
BBS MAC
CLB MAC
CS_EQU_0 MAC
CS_EQU_1 MAC
D14 VAL 0x00000001
DIO_EQU_0 MAC
DIO_EQU_1 MAC
DIR_IN MAC
DIR_OUT MAC
GC0 VAL 0x00000000
GC1 VAL 0x00000000
GC2 VAL 0x00000000
GC3 VAL 0x00000000
GC4 VAL 0x00000000
GC5 VAL 0x00000000
GC6 VAL 0x00000000
GC7 VAL 0x00000000
GC8 VAL 0x00000000
GC9 VAL 0x00000000
IS_5514_OFF MAC
IS_5514_ON MAC
IS_D14_OFF MAC
IS_D14_ON MAC
IS_LTP_OFF MAC
IS_LTP_ON MAC
IS_M2 MAC
IS_TX2 MAC
OFF VAL 0x00000000
ON VAL 0x00000001
POP_REG MAC
PUSH_REG MAC
RST_IN_OFF MAC
RST_IN_ON MAC
S100_W2 MAC
S1_W2 MAC
SEB MAC
SK_EQU_0 MAC
SK_EQU_1 MAC
UP_COM VAL 0x00000000
if_finance_on MAC
interval_tm_disable
MAC
interval_tm_enable
MAC
User defined identifier, 45 symbol(s)
Macro processing end, No error
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -