1    /*
2     * Some or all of this work - Copyright (c) 2006 - 2021, Intel Corp.
3     * All rights reserved.
4     *
5     * Redistribution and use in source and binary forms, with or without modification,
6     * are permitted provided that the following conditions are met:
7     *
8     * Redistributions of source code must retain the above copyright notice,
9     * this list of conditions and the following disclaimer.
10     * Redistributions in binary form must reproduce the above copyright notice,
11     * this list of conditions and the following disclaimer in the documentation
12     * and/or other materials provided with the distribution.
13     * Neither the name of Intel Corporation nor the names of its contributors
14     * may be used to endorse or promote products derived from this software
15     * without specific prior written permission.
16     *
17     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19     * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20     * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21     * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23     * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25     * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27     */
28    /*
29     * ToInteger(<0x-hex-dec>)
30     */
31    Method (MF92, 0, NotSerialized)
32    {
33        /* Hex: 0x - dec */
34
35        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
36        ToInteger ("0x0", Local0)
37        If ((Local0 != 0x00))
38        {
39            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
40        }
41
42        ToInteger ("0x0000000", Local0)
43        If ((Local0 != 0x00))
44        {
45            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
46        }
47
48        ToInteger ("0x1", Local0)
49        If ((Local0 != 0x01))
50        {
51            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x01)
52        }
53
54        ToInteger ("0x12345678", Local0)
55        If ((Local0 != 0x12345678))
56        {
57            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x12345678)
58        }
59
60        ToInteger ("0x12345", Local0)
61        If ((Local0 != 0x00012345))
62        {
63            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00012345)
64        }
65
66        If (F64)
67        {
68            Local1 = "0x1234567890123456"
69            ToInteger (Local1, Local0)
70            If ((Local0 != 0x1234567890123456))
71            {
72                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x1234567890123456)
73            }
74
75            Local1 = "0x123456789012345"
76            ToInteger (Local1, Local0)
77            If ((Local0 != 0x0123456789012345))
78            {
79                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x0123456789012345)
80            }
81        }
82
83        /* Hex: 0x - hex */
84
85        ToInteger ("0xabcdefef", Local0)
86        If ((Local0 != 0xABCDEFEF))
87        {
88            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xABCDEFEF)
89        }
90
91        ToInteger ("0xabcdef", Local0)
92        If ((Local0 != 0x00ABCDEF))
93        {
94            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00ABCDEF)
95        }
96
97        If (F64)
98        {
99            Local1 = "0xabcdefefadefbcdf"
100            ToInteger (Local1, Local0)
101            If ((Local0 != 0xABCDEFEFADEFBCDF))
102            {
103                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xABCDEFEFADEFBCDF)
104            }
105
106            Local1 = "0xabcdefefadefbcd"
107            ToInteger (Local1, Local0)
108            If ((Local0 != 0x0ABCDEFEFADEFBCD))
109            {
110                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x0ABCDEFEFADEFBCD)
111            }
112        }
113
114        /* Hex: 0x - dec/hex */
115
116        ToInteger ("0x1ab2cd34", Local0)
117        If ((Local0 != 0x1AB2CD34))
118        {
119            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x1AB2CD34)
120        }
121
122        If (F64)
123        {
124            Local1 = "0x1ab2cd340fe05678"
125            ToInteger (Local1, Local0)
126            If ((Local0 != 0x1AB2CD340FE05678))
127            {
128                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x1AB2CD340FE05678)
129            }
130
131            Local1 = "0x1ab2cd340fe0"
132            ToInteger (Local1, Local0)
133            If ((Local0 != 0x00001AB2CD340FE0))
134            {
135                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00001AB2CD340FE0)
136            }
137        }
138
139        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
140    }
141
142    /*
143     * ToInteger(<dec>)
144     */
145    Method (MF93, 0, NotSerialized)
146    {
147        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
148        ToInteger ("0", Local0)
149        If ((Local0 != 0x00))
150        {
151            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
152        }
153
154        ToInteger ("0000000", Local0)
155        If ((Local0 != 0x00))
156        {
157            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
158        }
159
160        ToInteger ("000000000000000", Local0)
161        If ((Local0 != 0x00))
162        {
163            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
164        }
165
166        ToInteger ("000000000000000000000000000000000000000000", Local0)
167        If ((Local0 != 0x00))
168        {
169            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
170        }
171
172        ToInteger ("1", Local0)
173        If ((Local0 != 0x01))
174        {
175            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x01)
176        }
177
178        ToInteger ("1234567890", Local0)
179        If ((Local0 != 0x499602D2))
180        {
181            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x499602D2)
182        }
183
184        ToInteger ("1234567", Local0)
185        If ((Local0 != 0x0012D687))
186        {
187            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x0012D687)
188        }
189
190        ToInteger ("4294967295", Local0)
191        If ((Local0 != 0xFFFFFFFF))
192        {
193            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
194        }
195
196        If (F64)
197        {
198            Local1 = "18446744073709551615"
199            ToInteger (Local1, Local0)
200            If ((Local0 != 0xFFFFFFFFFFFFFFFF))
201            {
202                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFFFFFFFFFF)
203            }
204        }
205
206        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
207    }
208
209    /*
210     * White space before image of Data is skipped
211     * (all examples above).
212     */
213    Method (MF94, 0, NotSerialized)
214    {
215        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
216        ToInteger ("                    0x0", Local0)
217        If ((Local0 != 0x00))
218        {
219            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
220        }
221
222        ToInteger ("                    0x00000", Local0)
223        If ((Local0 != 0x00))
224        {
225            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
226        }
227
228        ToInteger (" 0x1", Local0)
229        If ((Local0 != 0x01))
230        {
231            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x01)
232        }
233
234        ToInteger ("  0x12345678", Local0)
235        If ((Local0 != 0x12345678))
236        {
237            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x12345678)
238        }
239
240        ToInteger ("   0x12345", Local0)
241        If ((Local0 != 0x00012345))
242        {
243            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00012345)
244        }
245
246        If (F64)
247        {
248            Local1 = "    0x1234567890123456"
249            ToInteger (Local1, Local0)
250            If ((Local0 != 0x1234567890123456))
251            {
252                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x1234567890123456)
253            }
254
255            Local1 = "    0x123456789012345"
256            ToInteger (Local1, Local0)
257            If ((Local0 != 0x0123456789012345))
258            {
259                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x0123456789012345)
260            }
261        }
262
263        ToInteger ("     0xabcdefef", Local0)
264        If ((Local0 != 0xABCDEFEF))
265        {
266            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xABCDEFEF)
267        }
268
269        ToInteger ("      0xabcdef", Local0)
270        If ((Local0 != 0x00ABCDEF))
271        {
272            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00ABCDEF)
273        }
274
275        ToInteger ("\t0xabcdef", Local0)
276        If ((Local0 != 0x00ABCDEF))
277        {
278            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00ABCDEF)
279        }
280
281        If (F64)
282        {
283            Local1 = "       0xabcdefefadefbcdf"
284            ToInteger (Local1, Local0)
285            If ((Local0 != 0xABCDEFEFADEFBCDF))
286            {
287                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xABCDEFEFADEFBCDF)
288            }
289
290            Local1 = "       0xabcdefefadefbcd"
291            ToInteger (Local1, Local0)
292            If ((Local0 != 0x0ABCDEFEFADEFBCD))
293            {
294                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x0ABCDEFEFADEFBCD)
295            }
296        }
297
298        ToInteger ("        0x1ab2cd34", Local0)
299        If ((Local0 != 0x1AB2CD34))
300        {
301            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x1AB2CD34)
302        }
303
304        If (F64)
305        {
306            Local1 = "         0x1ab2cd340fe05678"
307            ToInteger (Local1, Local0)
308            If ((Local0 != 0x1AB2CD340FE05678))
309            {
310                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x1AB2CD340FE05678)
311            }
312
313            Local1 = "         0x1ab2cd340fe0"
314            ToInteger (Local1, Local0)
315            If ((Local0 != 0x00001AB2CD340FE0))
316            {
317                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00001AB2CD340FE0)
318            }
319        }
320
321        ToInteger ("          0", Local0)
322        If ((Local0 != 0x00))
323        {
324            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
325        }
326
327        ToInteger (" \t0000000", Local0)
328        If ((Local0 != 0x00))
329        {
330            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
331        }
332
333        ToInteger ("\t000000000000000", Local0)
334        If ((Local0 != 0x00))
335        {
336            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
337        }
338
339        ToInteger (" 000000000000000000000000000000000000000000", Local0)
340        If ((Local0 != 0x00))
341        {
342            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
343        }
344
345        ToInteger ("           1", Local0)
346        If ((Local0 != 0x01))
347        {
348            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x01)
349        }
350
351        ToInteger ("            1234567890", Local0)
352        If ((Local0 != 0x499602D2))
353        {
354            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x499602D2)
355        }
356
357        ToInteger ("\t1234567890", Local0)
358        If ((Local0 != 0x499602D2))
359        {
360            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x499602D2)
361        }
362
363        ToInteger ("\t\t\t\t\t\t\t\t\t1234567890", Local0)
364        If ((Local0 != 0x499602D2))
365        {
366            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x499602D2)
367        }
368
369        ToInteger ("  \t           1234567", Local0)
370        If ((Local0 != 0x0012D687))
371        {
372            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x0012D687)
373        }
374
375        ToInteger ("     \t         4294967295", Local0)
376        If ((Local0 != 0xFFFFFFFF))
377        {
378            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
379        }
380
381        If (F64)
382        {
383            Local1 = "               \t18446744073709551615"
384            ToInteger (Local1, Local0)
385            If ((Local0 != 0xFFFFFFFFFFFFFFFF))
386            {
387                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFFFFFFFFFF)
388            }
389        }
390
391        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
392    }
393
394    /*
395     * Zeros before significant characters in image without '0x' are skipped).
396     */
397    Method (MF95, 0, NotSerialized)
398    {
399        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
400        ToInteger ("          0", Local0)
401        If ((Local0 != 0x00))
402        {
403            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x00)
404        }
405
406        ToInteger ("          2", Local0)
407        If ((Local0 != 0x02))
408        {
409            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x02)
410        }
411
412        ToInteger ("          0xa", Local0)
413        If ((Local0 != 0x0A))
414        {
415            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x0A)
416        }
417
418        ToInteger ("          04294967295", Local0)
419        If ((Local0 != 0xFFFFFFFF))
420        {
421            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
422        }
423
424        ToInteger ("04294967295", Local0)
425        If ((Local0 != 0xFFFFFFFF))
426        {
427            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
428        }
429
430        ToInteger ("000000000000000000004294967295", Local0)
431        If ((Local0 != 0xFFFFFFFF))
432        {
433            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
434        }
435
436        ToInteger (" 000000000000000000004294967295", Local0)
437        If ((Local0 != 0xFFFFFFFF))
438        {
439            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
440        }
441
442        ToInteger ("\t000000000000000000004294967295", Local0)
443        If ((Local0 != 0xFFFFFFFF))
444        {
445            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
446        }
447
448        ToInteger ("\t \t \t \t \t000000000000000000004294967295", Local0)
449        If ((Local0 != 0xFFFFFFFF))
450        {
451            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
452        }
453
454        ToInteger ("\t \t \t \t \t04294967295", Local0)
455        If ((Local0 != 0xFFFFFFFF))
456        {
457            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFF)
458        }
459
460        ToInteger ("\t \t \t \t \t0123456789", Local0)
461        If ((Local0 != 0x075BCD15))
462        {
463            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x075BCD15)
464        }
465
466        ToInteger ("0123456789", Local0)
467        If ((Local0 != 0x075BCD15))
468        {
469            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x075BCD15)
470        }
471
472        ToInteger ("00123456789", Local0)
473        If ((Local0 != 0x075BCD15))
474        {
475            ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0x075BCD15)
476        }
477
478        If (F64)
479        {
480            Local1 = "               \t018446744073709551615"
481            ToInteger (Local1, Local0)
482            If ((Local0 != 0xFFFFFFFFFFFFFFFF))
483            {
484                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFFFFFFFFFF)
485            }
486
487            Local1 = "018446744073709551615"
488            ToInteger (Local1, Local0)
489            If ((Local0 != 0xFFFFFFFFFFFFFFFF))
490            {
491                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFFFFFFFFFF)
492            }
493
494            Local1 = "000000000000000000000000000000000000000018446744073709551615"
495            ToInteger (Local1, Local0)
496            If ((Local0 != 0xFFFFFFFFFFFFFFFF))
497            {
498                ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, Local0, 0xFFFFFFFFFFFFFFFF)
499            }
500        }
501
502        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
503    }
504
505    /*
506     * ToInteger, exceptions
507     */
508    Method (MF96, 0, NotSerialized)
509    {
510        /* 5. "1234cd" (non-decimal character in dec-image) */
511
512        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
513        Local1 = "1234cd"
514        ToInteger (Local1, Local0)
515        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
516        /* 6. "000x1234" (non-decimal character in dec-image) */
517
518        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
519        Local1 = "000x1234"
520        ToInteger (Local1, Local0)
521        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
522        /* 7. "0x1234cdQ" (non-hex character in '0x'-image) */
523
524        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
525        Local1 = "0x1234cdQ"
526        ToInteger (Local1, Local0)
527        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
528        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
529        Local1 = "0x0x12345"
530        ToInteger (Local1, Local0)
531        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
532        /* 8. "1234 " (white space in dec image) */
533
534        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
535        Local1 = "1234 "
536        ToInteger (Local1, Local0)
537        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
538        /* 9. "0x1234cd " (white space in '0x'-image) */
539
540        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
541        Local1 = "0x1234cd "
542        ToInteger (Local1, Local0)
543        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
544        /* 10. "0x 1234cdQ" (white space after '0x') */
545
546        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
547        Local1 = "0x 1234"
548        ToInteger (Local1, Local0)
549        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
550        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
551        Local1 = "0x0x 1234"
552        ToInteger (Local1, Local0)
553        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
554        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
555        Local1 = "0x0x 0x 1234"
556        ToInteger (Local1, Local0)
557        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
558        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
559        Local1 = "0x 0x 1234"
560        ToInteger (Local1, Local0)
561        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
562        /* 11. (decimal image exceeding maximal) */
563        /*     32-bit mode � the value exceeding "4294967295" */
564        If (!F64)
565        {
566            CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
567            Local1 = "4294967296"
568            ToInteger (Local1, Local0)
569            CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
570            CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
571            Local1 = "123456789012345678904294967296"
572            ToInteger (Local1, Local0)
573            CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
574            CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
575            Local1 = " \t \t\t00004294967296"
576            ToInteger (Local1, Local0)
577            CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
578            CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
579            Local1 = "\t0123456789012345678904294967296"
580            ToInteger (Local1, Local0)
581            CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
582            CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
583            Local1 = "0123456789012345678904294967296"
584            ToInteger (Local1, Local0)
585            CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
586            CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
587            Local1 = " 123456789012345678904294967296"
588            ToInteger (Local1, Local0)
589            CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
590            CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
591            Local1 = "\t123456789012345678904294967296"
592            ToInteger (Local1, Local0)
593            CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
594        }
595
596        /*     64-bit mode � the value exceeding "18446744073709551615" */
597
598        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
599        Local1 = "18446744073709551616"
600        ToInteger (Local1, Local0)
601        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
602        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
603        Local1 = "\t18446744073709551616"
604        ToInteger (Local1, Local0)
605        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
606        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
607        Local1 = " 18446744073709551616"
608        ToInteger (Local1, Local0)
609        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
610        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
611        Local1 = "018446744073709551616"
612        ToInteger (Local1, Local0)
613        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
614        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
615        Local1 = " \t000000000018446744073709551616"
616        ToInteger (Local1, Local0)
617        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
618        /* 12. "0x12345678901234567" (hex image exceeding maximal) */
619
620        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
621        Local1 = "0x12345678901234567"
622        ToInteger (Local1, Local0)
623        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
624        /* 13. "0x00000000000001234" (hex image exceeding maximal; no matter that zeros) */
625
626        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
627        Local1 = "0x00000000000001234"
628        ToInteger (Local1, Local0)
629        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
630        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
631        Local1 = "0x0000000000000000000001234"
632        ToInteger (Local1, Local0)
633        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
634        /* 14. "0x123456789" (hex image exceeding maximal; for 32-bit mode only) */
635
636        If (!F64)
637        {
638            CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
639            Local1 = "0x123456789"
640            ToInteger (Local1, Local0)
641            CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
642        }
643
644        /* 15. "0x" (incomplete '0x' image) */
645
646        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
647        Local1 = "0x"
648        ToInteger (Local1, Local0)
649        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
650        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
651        Local1 = "0x "
652        ToInteger (Local1, Local0)
653        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
654        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
655        Local1 = "0x\t"
656        ToInteger (Local1, Local0)
657        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
658        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
659        Local1 = "0x 1234"
660        ToInteger (Local1, Local0)
661        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
662        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
663        Local1 = "0x\t1234"
664        ToInteger (Local1, Local0)
665        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
666        /* 16. Empty string */
667
668        CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
669        Local1 = ""
670        ToInteger (Local1, Local0)
671        CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00)
672    }
673