FreeCalypso > hg > fc-selenite
annotate src/gpf/ccd/bcdodd.c @ 78:95ef11e76c5b
src/cs/system/main/gcc: asm code pieced from Citrine
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 20 Jul 2018 06:46:56 +0000 |
parents | 1ea54a97e831 |
children |
rev | line source |
---|---|
5
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 +----------------------------------------------------------------------------- |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 | Project : |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 | Modul : bcdodd.c |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 +----------------------------------------------------------------------------- |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 | Copyright 2002 Texas Instruments Berlin, AG |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 | All rights reserved. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 | This file is confidential and a trade secret of Texas |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 | Instruments Berlin, AG |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 | The receipt of or possession of this file does not convey |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 | any rights to reproduce or disclose its contents or to |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 | manufacture, use, or sell anything it may describe, in |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 | whole, or in part, without the specific written consent of |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 | Texas Instruments Berlin, AG. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 +----------------------------------------------------------------------------- |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 | Purpose : Definition of encoding and decoding functions for BCDODD elements |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 +----------------------------------------------------------------------------- |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 * standard definitions like GLOBAL, UCHAR, ERROR etc. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #include "typedefs.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #include "header.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 * Prototypes of ccd (USE_DRIVER EQ undef) for prototypes only |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 * look at ccdapi.h |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #undef USE_DRIVER |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #include "ccdapi.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 * Types and functions for bit access and manipulation |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #include "ccd_globs.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #include "bitfun.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 * Prototypes of ccd internal functions |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 #include "ccd.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 * Declaration of coder/decoder tables |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 #include "ccdtable.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 #include "ccddata.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 #ifndef RUN_INT_RAM |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 +--------------------------------------------------------------------+ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 | PROJECT : CCD (6144) MODULE : CCD | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 | STATE : code ROUTINE : cdc_bcdodd_decode | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 +--------------------------------------------------------------------+ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 PURPOSE : |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 SHORT cdc_bcdodd_decode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs) |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 #ifdef DEBUG_CCD |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 #ifndef CCD_SYMBOLS |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 TRACE_CCD (globs, "cdc_bcdodd_decode()"); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 #else |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 TRACE_CCD (globs, "cdc_bcdodd_decode() %s", ccddata_get_alias((USHORT) e_ref, 1)); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 #endif |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 #endif |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 cdc_BCD_decode (e_ref, 1, globs); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 return 1; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 } |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 #endif /* !RUN_INT_RAM */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 #ifndef RUN_INT_RAM |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 +--------------------------------------------------------------------+ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 | PROJECT : CCD (6144) MODULE : CCD | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 | STATE : code ROUTINE : cdc_bcdodd_encode | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 +--------------------------------------------------------------------+ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 PURPOSE : encoding a Bytearray, that contain a BCD Number, into |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 the bitstream. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 SHORT cdc_bcdodd_encode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs) |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 #ifdef DEBUG_CCD |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 #ifndef CCD_SYMBOLS |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 TRACE_CCD (globs, "cdc_bcdodd_encode()"); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 #else |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 TRACE_CCD (globs, "cdc_bcdodd_encode() %s", ccddata_get_alias((USHORT) e_ref, 1)); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 #endif |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 #endif |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 cdc_BCD_encode (e_ref, 1, globs); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 return 1; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 } |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 #endif /* !RUN_INT_RAM */ |