📄 sam2t.l
字号:
Wed Nov 05 14:48:17 2003
SAM4 Assembler for 57 Core Ver. 2.09T(Win32) Copyright(c) 1999 Samsung Electronics Co.
--------------------------------------------------------------------
Source File Name : Sam2T.SRC
Output File Name : Sam2T.o
List File Name : Sam2T.l
1 ;----------------------------------------------------------------------------
2 ;
3 ; Project : High Resolution Kitchen SCALE
4 ; File : HighRes.src
5 ; : HighRes.inc
6 ; : 57c2304.reg
7 ; Creation Date : 10 Oct 2000
8 ; By : KP Yiu (Oriental Skill Ltd.)
9 ; Modified By : KL Tsang (Oriental Skill Ltd.)
10 ; Release Date :
11 ; Release Version : v.1.01.0000
12 ; Version Notes : v.1.01.0000
13 ;; - improve count fructration problem by adding PermitUpdate & modified
14 ;; AverageSample function.
15 ;; v.2.02.0000
16 ;; - improve auto-revert to zero feature to make the 2s counting more accurate.
17 ;; Develop Notes : High Resolution Scale
18 ;; v.0.6.0000
19 ;; - improve count taken problem after pull the scale
20 ;; - add 1s delay between Totalling and Tare for get stable count
21 ;; - zero bound change from fix 30 counts to 2 display step
22 ;; v.0.7.0000
23 ;; - add 3s delay before get zero
24 ;; - after creeping & 8s, if display weight = 0, put current count into zero
25 ;; - add 1.5s delay after press keys
26 ;; - change power control logic
27 ;; v.0.8.0000
28 ;; - after creeping and display zero, the time is changed from 8s to 2s
29 ;; - use new LCD
30 ;; v.0.9.0000
31 ;; - display 1x.xxx kg use new LCD
32 ;; - hold any keys, no display change
33 ;; v.0.10.0000
34 ;; - solve the sleep time problem -- scale don't sleep in 1 min after display is zero
35 ;; - add mode 1 - calculate the display
36 ;; - add display method for mode 1
37 ;; v.0.11.0000 (By Pang - 18 Feb 2002)
38 ;; - merge with Dennis program
39 ;; - Correct the mode table to display accurate 115% weight limit.
40 ;; - Correct the power up display as "8888 7/8" for mode 1-5,
41 ;; "18888 7/8" for mode 6 & 7 and "8888" for mode 8
42 ;; - Optimize the routine "SetFactoryMode"
43 ;; - Correct On/Zero button to MaB
44 ;; - Remark dummy instructions in routine "Sleep"
45 ;; v.0.12.0000 (By Pang - 25 Feb 2002)
46 ;; - update the program according to the email dated 25 Feb 2002 from Dennis
47 ;; -> Changed back power up display on mode 6 & 7 to "8888 7/8"
48 ;; -> Fix the power up click sound problem
49 ;; -> Fix a underweight bug
50 ;; v.1.5.0000 (By Dennis Wong - 3 Apr 2003)
51 ;; - Remove emulator rountine
52 ;; - Debug auto power off problem that sleep timer cannot reset at least 5sec
53 ;; v.1.6.0000 (By Dennis Wong - 28 Apr 2003)
54 ;; - Add fl.oz mode for all resolution
55 ;; v.1.6.0001 (By Dennis Wong - 28 May 2003)
56 ;; - Update the maximum capacity of fl.oz mode
57 ;; v.1.7.0000 (By Dennis Wong - 3 Jun 2003)
58 ;; - Use 'HoldEn' to be hold function enable flag to elimate calibration hold problem
59 ;; - Use 'TareNow' to be tare function enable flag
60 ;; - Modify clear icon rountine to free space
61 ;; - Debug fl.oz mode of 200g x 0.1g resolution
62 ;;
63 ;----------------------------------------------------------------------------
64
65 .include "57c2304.reg"
66 ; 57C2304.REG Copyright (c) 1996 SAMSUNG ELECTRONICS CO.
67
68 .list on
69
70 ; END OF 57C2304.REG
71
72
73 .include "HighRes.inc"
74 ;----------------------------------------------------------------------------
75 ;
76 ; Project : High Resolution Kitchen Scale
77 ; File : HighRes.INC
78 ; Creation Date : 10 Oct 2000
79 ; By : KP Yiu (Oriental Skill Ltd.)
80 ; Release Date :
81 ; Release Version : v.1.01.0000
82 ;
83 ;----------------------------------------------------------------------------
84
85 .list on
86 ;=================================
87 ; ----- Variables Definition -----
88 ; ----- Range % 020h - 0afh -----
89 ; ----- Stack % 0b0h - 0ffh -----
90 ;=================================
91
92 0000 .ram_org VariableStart ; 020h
93 02 .align 2
94
95 0000 .ram_org 020h ;(020h - 02fh)
96 20 OperFlg1 .ram_ds 1 ;(020)
97 20 32 UnitMode: .bit OperFlg1.2 ; b3,2 = 0: g(Default); 1 = oz; 2 = ml; 3 = fl.oz
98 20 33 SolLiqMode: .bit OperFlg1.3 ; 0 = solid, 1 = liquid
99
100 21 OperFlg2 .ram_ds 1 ;(021)
101 21 30 KeyHeldNow: .bit OperFlg2.0 ; b0 = 1: Key held now
102 21 31 CntPeriodNow: .bit OperFlg2.1 ; b1 = 0: Discharging Period; 1:Counting Period
103 21 32 CntDspNow: .bit OperFlg2.2 ; b2 = 1: Count display
104 21 33 WeightTareNow: .bit OperFlg2.3 ; b3 = 1: Weight Tare Now
105 22 OperFlg3 .ram_ds 1 ;(022)
106 22 30 Chge4stepNow: .bit OperFlg3.0 ; b0 = 1: 4 steps changed Now
107 22 31 ZeroDspNow: .bit OperFlg3.1 ; b1 = 1: Screen show zero now
108 22 32 CalibrateOn: .bit OperFlg3.2 ; b2 = 1: Enable Calibration mode
109 22 33 CaliMethod: .bit OperFlg3.3 ; b3 = 1: Calibration Method 2, 0: Calibration Method 1
110 23 OperFlg4 .ram_ds 1 ;(023)
111 23 30 CreepZero: .bit OperFlg4.0
112 23 31 AutoZeroNow: .bit OperFlg4.1 ; b1 = 1: Auto revert to Zero now
113 23 32 HexCalFlg: .bit OperFlg4.2 ; b2 = 1: Hexadecimal calculation
114 23 33 EnCreeping: .bit OperFlg4.3 ; b2 = 1: Enable creeping elimination
115 24 OperFlg5 .ram_ds 1 ;(024)
116 24 30 SleepNow: .bit OperFlg5.0 ; b0 = 1: Sleep time rearched 0
117 24 31 TimrFinished: .bit OperFlg5.1 ; b1 = 1: Creep time finished
118 24 32 HoldEn: .bit OperFlg5.2 ; b2 = 1: Hold function enable
119 24 33 TareNow: .bit OperFlg5.3 ; b3 = 1: Tare occur
120 25 OperFlg6 .ram_ds 1 ;(025)
121 25 30 AutoZeroEn: .bit OperFlg6.0 ; b0 = 1: Auto-zero feature enabled
122 25 31 PowerOffTim: .bit OperFlg6.1 ; b1 = 1: 3min Auto power off time
123 25 32 AutoOffEn: .bit OperFlg6.2 ; b2 = 0: Auto power off feature enabled
124 25 33 UnitSwOpt: .bit OperFlg6.3 ; b3 = 0: priority switch
125
126 26 OperFlg7 .ram_ds 1 ;(026)
127 26 30 OvrHiVoltNow: .bit OperFlg7.0 ; b0 = 1: Over Hi-Volt Boundary Now
128 26 31 BlwLoVoltNow: .bit OperFlg7.1 ; b1 = 1: Below Lo-Volt Boundary Now
129 26 32 OvrAbMaxNow: .bit OperFlg7.2 ; b2 = 1: Now Over Absolute Max Count
130 26 33 IdleBatLowNow: .bit OperFlg7.3 ; b3 = 1: Battery Low display Now
131
132 27 OperFlg8 .ram_ds 1 ;(027)
133 27 30 CnstRdNow: .bit OperFlg8.0 ; b0 = 1: Constant reading now
134 27 31 OvrWtNow: .bit OperFlg8.1 ; b1 = 1: Overloading now
135 27 32 UdrWtNow: .bit OperFlg8.2 ; b2 = 1: Underweighting now
136 27 33 ZeroRdNow: .bit OperFlg8.3 ; b3 = 1: Zero reading now
137
138 28 OperFlg9 .ram_ds 1 ;(028)
139 28 30 IdleCnstRdNow: .bit OperFlg9.0 ; b0 = 1: Constant Reading Now
140 28 31 IdleOvrWtNow: .bit OperFlg9.1 ; b1 = 1: Error display Now
141 28 32 IdleUdrWtNow: .bit OperFlg9.2 ; b2 = 1: Underweight display Now
142 28 33 IdleZeroRdNow: .bit OperFlg9.3 ; b3 = 1: Zero Reading Now
143
144 29 BCNT_183ms .ram_ds 1 ;(029) Count 183ms from BCNT Count
145 2A BCNT_500ms .ram_ds 1 ;(02A) Count 513ms from BCNT Counter
146
147 2B OperFlg10 .ram_ds 1 ;(02B)
148 2B 30 CntOvrflow: .bit OperFlg10.0 ; b0 = 1: discharge counting overflow (mean reg L)
149 2B 31 TotalFlag: .bit OperFlg10.1 ; b1 = 1: Totalling occur
150 2B 32 ChgeSlpTmrNow: .bit OperFlg10.2 ; b2 = 1 : Change Sleep Timer Now
151 2B 33 ZeroOne: .bit OperFlg10.3 ; b3 = 1: reading = 0 to 1
152
153 2C ZeroCount .ram_ds 4 ;(02C) Zero Reading Count in hex(2B)
154
155 0000 .ram_org 034h ;(034h - 03fh)
156 34 BCNT_36ms .ram_ds 1 ;(034) Count 36.6ms from BCNT Counter
157 35 BCNT_1s_H .ram_ds 1 ;(035) Count 1s from BCNT Counter (High nibble)
158 36 BCNT_1s_M .ram_ds 1 ;(036) Count 1s from BCNT Counter (Middle nibble)
159 37 BCNT_1s_L .ram_ds 1 ;(037) Count 1s from BCNT Counter (Low nibble)
160
161 0000 .ram_org 038h
162 38 StartZero .ram_ds 4 ;(038) Store first zero reading turn on
163 3C SleepTimL .ram_ds 2 ;(03C) Sleep timer
164 3E SleepTimH .ram_ds 1 ;(03E) Sleep timer
165 3F HoldTimer .ram_ds 1 ;(03F) Hold timer
166
167 0000 .ram_org 045h ;(045h - 04bh)
168 45 FactoryMode .ram_ds 1 ;(045) Factory setting of Mode(0..7)
169 45 30 FtyMode_K1: .bit FactoryMode.0 ; b0 = K1
170 45 31 FtyMode_K2: .bit FactoryMode.1 ; b1 = K2
171 45 32 FtyMode_K3: .bit FactoryMode.2 ; b2 = K3
172 45 33 FtyMode_K4: .bit FactoryMode.3 ; b3 = K4
173 46 AverageCount .ram_ds 4 ;(046) Average Count of Sample Count 0 & 1 in hex
174 4A LDigitPos .ram_ds 1 ;(04A) LCD Large Digit Position (0..3)
175 4B AutoZeroTim .ram_ds 1 ;(04B) Auto revert to zero delay timer
176
177 0000 .ram_org 056h ;(056h - 05fh)
178 56 SampleCount0 .ram_ds 4 ;(056) Sample Count 0 in hex(2B)
179 5A SampleCount1 .ram_ds 4 ;(05A) Sample Count 1 in hex(2B)
180 5E CntTCNT .ram_ds 2 ;(05E) Count num of TCNT Match
181
182 0000 .ram_org 066h ;(066h - 06fh)
183 66 PreviousCount .ram_ds 4 ;(066) Previous count for creeping checking
184 6A NewWeightCnt .ram_ds 4 ;(06A) Weight Count = Average Count - Zero Count in hex
185 6E Tag2sec .ram_ds 2 ;(06E) Store 2sec time for key hold
186
187 0000 .ram_org 075h ;(075h - 07fh)
188 75 MaB_Key .ram_ds 1 ;(075) Flag for Mab key
189 75 30 KeyKGLB: .bit MaB_Key.0 ; kg/lb key
190 75 31 KeyFlozML: .bit MaB_Key.1 ; Fl.oz/ml key
191 75 32 KeyHold: .bit MaB_Key.2 ; Hold key
192
193 76 SleepTimLRL .ram_ds 2 ;(076) Sleep Timer Low nibble Reload value
194 78 SleepTimHRL .ram_ds 1 ;(078) Sleep Timer High nibble Reload value
195 79 CreepTimer .ram_ds 1 ;(079) Creeping timer
196 7A ZeroBound .ram_ds 4 ;(07A) Zero Boundary to display underload(absolute count)
197 7E SDigitx_8 .ram_ds 1 ;(07E) LCD Small Digit display Value
198 7F HoldState .ram_ds 1 ;(07F) For Hold check stable count
199 7F 30 HoldStableChk: .bit HoldState.0 ; b0 = 1: Goto check hold stable
200 7F 31 HoldRd: .bit HoldState.1 ; b1 = 1: Holding Reading
201 7F 32 HoldRdChange: .bit HoldState.2 ; b2 = 1: Hold Reading Change
202 7F 33 HoldNotAllow: .bit HoldState.3 ; b3 = 1: Hold Reading is allowed
203
204 0000 .ram_org 085h
205 85 HaveData .ram_ds 1 ;(085) Sampling Flags
206 85 30 HaveSample0: .bit HaveData.0 ; Bit 0 = 0: Sample Count 0 is Empty
207 85 31 HaveSample1: .bit HaveData.1 ; Bit 1 = 0: Sample Count 1 is Empty
208 85 32 UpdateSample0: .bit HaveData.2 ; Bit 2 = 0: Update Sample 0
209 85 33 PermitUpdate: .bit HaveData.3 ; Bit 3 = 0: Permit update Sample
210 86 Iconset0 .ram_ds 1 ;(086) lb, kg, S3 icons (can directly load to 1e0h for dsp)
211 86 30 Icon_lb: .bit Iconset0.0 ; lb icon (Iconset0 must at even address)
212 86 31 Icon_kg: .bit Iconset0.1 ; kg icon
213 86 32 Icon_LoBat: .bit Iconset0.2 ; low battery icon (S3)
214 86 33 Icon_DPt2: .bit Iconset0.3 ; decimal pt. 2 icon "##.###"
215 87 Iconset1 .ram_ds 1 ;(087) P1, COL, g, oz icons
216 87 30 Icon_DPt1: .bit Iconset1.0 ; decimal pt. 1 icon "#.####"
217 87 31 Icon_Col: .bit Iconset1.1 ; colon mark icon
218 87 32 Icon_g: .bit Iconset1.2 ; g icon
219 87 33 Icon_oz: .bit Iconset1.3 ; oz icon
220 88 Iconset2 .ram_ds 1 ;(088) S2, S1, fl.oz, ml icons (can load directly for dsp)
221 88 30 Icon_Hold: .bit Iconset2.0 ; Hold icon (S2)
222 ; Icon_Timr: .bit Iconset2.1 ; Timer icon (S1)
223 88 32 Icon_fl: .bit Iconset2.2 ; fl.oz icon
224 88 33 Icon_ml: .bit Iconset2.3 ; ml icon
225 89 Iconset3 .ram_ds 1 ;(089)
226 89 30 Icon_DPt3: .bit Iconset3.0 ; Decimal pt. 3 icon "####.#"
227 89 31 Icon_Tare: .bit Iconset3.1 ; Tare icon
228 89 32 Icon_One: .bit Iconset3.2 ; One
229
230 8A Chge4stepTimer .ram_ds 1 ;(08A) For 4 step change delay
231
232 0000 .ram_org 08Ch
233 8C HoldChkCount .ram_ds 4 ;(08C)
234
235 ; the followings variables need a fixed address
236 00 30 HexBuf .equ 030h ; Max 16-bit Hex
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -