📄 kclock2.lst
字号:
231 45 31 FtyMode_K2: .bit FactoryMode.1 ; b1 = K2
232 45 32 FtyMode_K3: .bit FactoryMode.2 ; b2 = K3
233 45 33 FtyMode_K4: .bit FactoryMode.3 ; b3 = K4
234 46 AverageCount .ram_ds 4 ;(046) Average Count of Sample Count 0 & 1 in hex
235 4A LDigitPos .ram_ds 1 ;(04A) LCD Large Digit Position (0..3)
236 4B AutoZeroTim .ram_ds 1 ;(04B) Auto revert to zero delay timer
237
238 0000 .ram_org 056h ;(056h - 05fh)
239 56 SampleCount0 .ram_ds 4 ;(056) Sample Count 0 in hex(2B)
240 5A SampleCount1 .ram_ds 4 ;(05A) Sample Count 1 in hex(2B)
241 5E CntTCNT .ram_ds 2 ;(05E) Count num of TCNT Match
242
243 0000 .ram_org 066h ;(066h - 06fh)
244 66 PreviousCount .ram_ds 4 ;(066) Previous count for creeping checking
245 6A NewWeightCnt .ram_ds 4 ;(06A) Weight Count = Average Count - Zero Count in hex
246 6E Tag2sec .ram_ds 2 ;(06E) Store 2sec time for key hold
247
248 0000 .ram_org 075h ;(075h - 07fh)
249 75 MaB_Key .ram_ds 1 ;(075) Flag for Mab key
250 75 30 KeyKGLB: .bit MaB_Key.0 ; kg/lb key
251 75 31 KeyFlozML: .bit MaB_Key.1 ; Fl.oz/ml key
252 75 32 KeyHold: .bit MaB_Key.2 ; Hold key
253
254 76 SleepTimLRL .ram_ds 2 ;(076) Sleep Timer Low nibble Reload value
255 78 SleepTimHRL .ram_ds 1 ;(078) Sleep Timer High nibble Reload value
256 79 CreepTimer .ram_ds 1 ;(079) Creeping timer
257 7A ZeroBound .ram_ds 4 ;(07A) Zero Boundary to display underload(absolute count)
258 7E SDigitx_8 .ram_ds 1 ;(07E) LCD Small Digit display Value
259 7F HoldState .ram_ds 1 ;(07F) For Hold check stable count
260 7F 30 HoldStableChk: .bit HoldState.0 ; b0 = 1: Goto check hold stable
261 7F 31 HoldRd: .bit HoldState.1 ; b1 = 1: Holding Reading
262 7F 32 HoldRdChange: .bit HoldState.2 ; b2 = 1: Hold Reading Change
263 7F 33 HoldNotAllow: .bit HoldState.3 ; b3 = 1: Hold Reading is allowed
264
265 0000 .ram_org 085h
266 85 HaveData .ram_ds 1 ;(085) Sampling Flags
267 85 30 HaveSample0: .bit HaveData.0 ; Bit 0 = 0: Sample Count 0 is Empty
268 85 31 HaveSample1: .bit HaveData.1 ; Bit 1 = 0: Sample Count 1 is Empty
269 85 32 UpdateSample0: .bit HaveData.2 ; Bit 2 = 0: Update Sample 0
270 85 33 PermitUpdate: .bit HaveData.3 ; Bit 3 = 0: Permit update Sample
271 86 Iconset0 .ram_ds 1 ;(086) lb, kg, S3 icons (can directly load to 1e0h for dsp)
272 86 30 Icon_lb: .bit Iconset0.0 ; lb icon (Iconset0 must at even address)
273 86 31 Icon_kg: .bit Iconset0.1 ; kg icon
274 86 32 Icon_LoBat: .bit Iconset0.2 ; low battery icon (S3)
275 86 33 Icon_DPt2: .bit Iconset0.3 ; decimal pt. 2 icon "##.###"
276 87 Iconset1 .ram_ds 1 ;(087) P1, COL, g, oz icons
277 87 30 Icon_DPt1: .bit Iconset1.0 ; decimal pt. 1 icon "#.####"
278 87 31 Icon_Col: .bit Iconset1.1 ; colon mark icon
279 87 32 Icon_g: .bit Iconset1.2 ; g icon
280 87 33 Icon_oz: .bit Iconset1.3 ; oz icon
281 88 Iconset2 .ram_ds 1 ;(088) S2, S1, fl.oz, ml icons (can load directly for dsp)
282 88 30 Icon_Hold: .bit Iconset2.0 ; Hold icon (S2)
283 ; Icon_Timr: .bit Iconset2.1 ; Timer icon (S1)
284 88 32 Icon_fl: .bit Iconset2.2 ; fl.oz icon
285 88 33 Icon_ml: .bit Iconset2.3 ; ml icon
286 89 Iconset3 .ram_ds 1 ;(089)
287 89 30 Icon_DPt3: .bit Iconset3.0 ; Decimal pt. 3 icon "####.#"
288 89 31 Icon_Tare: .bit Iconset3.1 ; Tare icon
289 89 32 Icon_One: .bit Iconset3.2 ; One
290
291 8A Chge4stepTimer .ram_ds 1 ;(08A) For 4 step change delay
292
293 0000 .ram_org 08Ch
294 8C HoldChkCount .ram_ds 4 ;(08C)
295
296 ; the followings variables need a fixed address
297 00 30 HexBuf .equ 030h ; Max 16-bit Hex
298 00 30 HexBuf0 .equ 030h ; most msb
299 00 31 HexBuf1 .equ 031h ;
300 00 32 HexBuf2 .equ 032h ;
301 00 33 HexBuf3 .equ 033h ; most lsb
302
303 00 40 DecBuf .equ 040h ; Max 5-digit BCD
304 00 40 DecBuf0 .equ 040h ; most msb
305 00 41 DecBuf1 .equ 041h ;
306 00 42 DecBuf2 .equ 042h ;
307 00 43 DecBuf3 .equ 043h ;
308 00 44 DecBuf4 .equ 044h ; most lsb
309
310 ; the followings variables need a fixed address
311 00 4C LDigit___1 .equ 4ch ; LCD Large Digit dsp for decimal place(1B)
312 00 4E LDigitxxx1 .equ 4eh ; LCD Large Digit dsp value(1B)
313 00 50 LDigitxx1x .equ 50h ; LCD Large Digit dsp value(1B)
314 00 52 LDigitx1xx .equ 52h ; LCD Large Digit dsp value(1B)
315 00 54 LDigit1xxx .equ 54h ; LCD Large Digit dsp value(1B)
316
317 ; for arithmetic calculation
318 00 60 YS_F_REG .equ 060h
319 00 60 YS_F_REG_0 .equ 060h ; most msb
320 00 61 YS_F_REG_1 .equ 061h ;
321 00 62 YS_F_REG_2 .equ 062h ;
322 00 63 YS_F_REG_3 .equ 063h ;
323 00 64 YS_F_REG_4 .equ 064h ; most lsb
324
325 00 70 YS_L_REG .equ 070h
326 00 70 YS_L_REG_0 .equ 070h ; most msb
327 00 71 YS_L_REG_1 .equ 071h ;
328 00 72 YS_L_REG_2 .equ 072h ;
329 00 73 YS_L_REG_3 .equ 073h ;
330 00 74 YS_L_REG_4 .equ 074h ; most lsb
331
332 00 80 YS_R_REG .equ 080h
333 00 80 YS_R_REG_0 .equ 080h ; most msb
334 00 81 YS_R_REG_1 .equ 081h ;
335 00 82 YS_R_REG_2 .equ 082h ;
336 00 83 YS_R_REG_3 .equ 083h ;
337 00 84 YS_R_REG_4 .equ 084h ; most lsb
338
339 ; the followings variables need a fixed address
340 00 90 NewWeightBCD .equ 090h ; New Weight obtained from AverageCount(2B)
341 00 90 NewWeightBCD0 .equ 090h ; most msb
342 00 91 NewWeightBCD1 .equ 091h ;
343 00 92 NewWeightBCD2 .equ 092h ;
344 00 93 NewWeightBCD3 .equ 093h ;
345 00 94 NewWeightBCD4 .equ 094h ; most lsb
346
347
348 ; the followings variables need a fixed address
349 00 96 Step1 .equ 096h ; 1st region dsp step(2B) - multipied by 10
350 00 9A Bound1 .equ 09Ah ; 1st Boundary of weighting display(2B)
351 00 9A MaxBound .equ 09Ah ; MaxBound
352 00 9E UnitCnt .equ 09Eh ; Unit count value(1B)
353 00 9E gRatio .equ 09Eh ; - 1g count ratio
354 00 9E oz1_8Ratio .equ 09Eh ; - 1/8oz count ratio
355 00 A0 ozRatio .equ 0A0h ; 1oz count ratio(2B)
356 00 A4 lbRatio .equ 0A4h ; 1lb count ratio(2B)
357
358 ;-----------------------------
359 00 A8 TimeoutTmr .equ 0A8h ; (1N) communication timeout timer 183*3 ms
360 00 A9 RxDataH .equ 0A9h
361 00 AA RxDataL .equ 0AAh
362
363 .list on
364
365 ;-----------------
366 00 01 VerD1 .equ 1
367 00 08 VerD2 .equ 8
368
369 ;----------------------------------------------------------------------------
370
371 0000 .origin VectorTable
372 0000 ResetVector
373 0000 8B 8B VENT0 1,0,Reset ; Reset Vector
374 0002 C0 8D VENT1 1,1,INTB_Int ;
375 0004 C1 2F VENT2 1,1,INT0_Int ;
376 0006 C0 80 VENT3 1,1,INT1_Int ;
377 000A ORG 00ah ;
378 000A C1 89 VENT5 1,1,INTT0_Int ;
379
380 ;----------------------------------------------------------------------------
381 ;
382 000C .origin Main1Loop
383
384 ;----------------------------------------------------------------------------
385 000C DD 66 IRETSB POP SB
386 000E D5 IRET
387 ;----------------------------------------------------------------------------
388 000F 2A RETHLEA POP HL
389 0010 28 POP EA
390 0011 C5 RET
391 ;----------------------------------------------------------------------------
392 0012 RETWXHLEA
393 0012 2C POP WX
394 0013 2A POP HL
395 0014 28 POP EA
396 0015 C5 RET
397 ;----------------------------------------------------------------------------
398 0016 RETYZWXHLEA
399 0016 2E POP YZ
400 0017 2C POP WX
401 0018 2A POP HL
402 0019 28 POP EA
403 001A C5 RET
404
405 ;***********************************************************
406 ; F: Copy Buf to Buf from xyH to x0H where x & y are any hex num
407 ; I: HL = Destination Buf(Buf end pointer)
408 ; WL = Source Buf(Buf end pointer)
409 ; O: HL = Duplicated Buf
410 ; D: A, HL
411 ;
412 001B 8F CpyBuf LD A,@WL ;
413 001C 7B XCHD A,@HL ;
414 001D 0D JR CpyBuf ;
415 001E C5 RET
416
417 ;----------------------------------------------------------------------------
418 ;
419 0020 .origin LookupTable
420
421 0020 DD 40 RSMB_Variable SMB VariableBank
422 0022 DD 4F RSMB_MemMapIO SMB MemMapIOBank
423 0024 DD 41 RSMB_LCD SMB LCDBank
424
425 0026 82 RINCS_2HL INCS HL ;
426 0027 82 INCS HL ;
427 0028 DC DA RDECS_HL DECS HL ;
428 002A DC F2 RLD_HLEA LD HL,EA ;
429 002C DC F4 RLD_WXEA LD WX,EA ;
430 002E 81 00 RLD_EA0 LD EA,#0 ;
431 0030 D9 09 RLD_E0 LD E,#0 ;
432 0032 D9 00 RCPSE_A0 CPSE A,#0 ;
433 0034 DC EA RCPSE_EAHL CPSE EA,HL ;
434 0036 DC AA RADC_EAHL ADC EA,HL ;
435
436
437 0038 CD 4E RLD_LDIGxxx1EA LD LDigitxxx1,EA
438 003A CD 50 RLD_LDIGxx1xEA LD LDigitxx1x,EA
439
440 003C 44 4D RDiv_YS TCALL Div_YS
441 003E 44 93 RRound_YS TCALL Round_YS
442 0040 49 91 RMul_10_FReg TCALL Mul_10_FReg
443 0042 49 9A RDiv_10_FReg TCALL Div_10_FReg
444 0044 44 3D RDouble_YS TCALL Double_YS
445
446 0046 49 A1 RCmpHex TCALL CmpHex
447 0048 40 1B RCpyBuf TCALL CpyBuf
448 004A 49 45 RHex2BCD_16 TCALL Hex2BCD_16
449 004C 4A 02 RSubHex TCALL SubHex
450
451 004E 4A 2B RSkipSRC_YZ TCALL SkipSRC_YZ
452 0050 49 69 RByteAry TCALL ByteAry
453 0052 49 71 RWrd2Ary TCALL Wrd2Ary
454 0054 4C F8 RStoreWordCode TCALL StoreWordCode
455 0056 4C F2 RStoreByteCode TCALL StoreByteCode
456
457 0058 4D 1C RDspSDigit TCALL DspSDigit
458 005A 4D 30 RDsp4LDigit TCALL Dsp4LDigit
459 005C 4D 4B RDspSymbol TCALL DspSymbol
460
461 005E 4A B8 RKScanDelay TCALL KScanDelay
462
463 0060 48 20 RCalWeightCnt TCALL CalWeightCount
464 0062 48 CA RActCurStp2Ary TCALL ActlCurStep2Ary
465 0064 48 C3 RCurStep2Ary TCALL CurStep2Ary
466 0066 48 D9 RSetBnd TCALL SetBnd
467 0068 48 F9 RGetAverageCnt TCALL GetAverageCnt
468 006A 48 3D RAverageSample TCALL AverageSample
469
470 006C 49 2B RNWCnt2FReg TCALL NWCnt2FReg
471 006E 49 31 RHxFReg2Dec TCALL HxFReg2Dec
472 0070 49 3A RCpy_R2FReg TCALL Cpy_R2FReg
473 0072 49 3D RCpy_F2LReg TCALL Cpy_F2LReg
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -