]> git.sur5r.net Git - cc65/blob - libsrc/cbm/ctype.s
Added getenv()
[cc65] / libsrc / cbm / ctype.s
1 ;
2 ; Ullrich von Bassewitz, 02.06.1998
3 ;
4 ; Character specification table.
5 ;
6
7 ; The tables are readonly, put them into the rodata segment
8
9 .rodata
10
11 ; The following 256 byte wide table specifies attributes for the isxxx type
12 ; of functions. Doing it by a table means some overhead in space, but it
13 ; has major advantages:
14 ;
15 ;   * It is fast. If it were'nt for the slow parameter passing of cc65, one
16 ;     could even define macros for the isxxx functions (this is usually
17 ;     done on other platforms).
18 ;
19 ;   * It is highly portable. The only unportable part is the table itself,
20 ;     all real code goes into the common library.
21 ;
22 ;   * We save some code in the isxxx functions.
23 ;
24 ;
25 ; Bit assignments:
26 ;
27 ;   0 - Lower case char
28 ;   1 - Upper case char
29 ;   2 - Numeric digit
30 ;   3 - Hex digit (both, lower and upper)
31 ;   4 - Control character
32 ;   5 - The space character itself
33 ;   6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v')
34 ;   7 - Space or tab character
35
36
37 ; The table is taken from Craig S. Bruce technical docs for the ACE os
38
39         .export         __ctype
40
41 __ctype:
42         .byte   $10     ;   0/00 ___rvs_@___
43         .byte   $10     ;   1/01 ___rvs_a___
44         .byte   $10     ;   2/02 ___rvs_b___
45         .byte   $10     ;   3/03 ___rvs_c___
46         .byte   $10     ;   4/04 ___rvs_d___
47         .byte   $10     ;   5/05 ___rvs_e___
48         .byte   $10     ;   6/06 ___rvs_f___
49         .byte   $10     ;   7/07 _BEL/rvs_g_
50         .byte   $10     ;   8/08 ___rvs_h___
51         .byte   $D0     ;   9/09 _TAB/rvs_i_
52         .byte   $50     ;  10/0a _BOL/rvs_j_
53         .byte   $10     ;  11/0b ___rvs_k___
54         .byte   $10     ;  12/0c ___rvs_l___
55         .byte   $50     ;  13/0d _CR_/rvs_m_
56         .byte   $10     ;  14/0e ___rvs_n___
57         .byte   $10     ;  15/0f ___rvs_o___
58         .byte   $10     ;  16/10 ___rvs_p___
59         .byte   $50     ;  17/11 _VT_/rvs_q_
60         .byte   $10     ;  18/12 ___rvs_r___
61         .byte   $10     ;  19/13 ___rvs_s___
62         .byte   $50     ;  20/14 _BS_/rvs_t_
63         .byte   $10     ;  21/15 ___rvs_u___
64         .byte   $10     ;  22/16 ___rvs_v___
65         .byte   $10     ;  23/17 ___rvs_w___
66         .byte   $10     ;  24/18 ___rvs_x___
67         .byte   $10     ;  25/19 ___rvs_y___
68         .byte   $10     ;  26/1a ___rvs_z___
69         .byte   $10     ;  27/1b ___rvs_[___
70         .byte   $10     ;  28/1c ___rvs_\___
71         .byte   $10     ;  29/1d ___rvs_]___
72         .byte   $10     ;  30/1e ___rvs_^___
73         .byte   $10     ;  31/1f _rvs_under_
74         .byte   $A0     ;  32/20 ___SPACE___
75         .byte   $00     ;  33/21 _____!_____
76         .byte   $00     ;  34/22 _____"_____
77         .byte   $00     ;  35/23 _____#_____
78         .byte   $00     ;  36/24 _____$_____
79         .byte   $00     ;  37/25 _____%_____
80         .byte   $00     ;  38/26 _____&_____
81         .byte   $00     ;  39/27 _____'_____
82         .byte   $00     ;  40/28 _____(_____
83         .byte   $00     ;  41/29 _____)_____
84         .byte   $00     ;  42/2a _____*_____
85         .byte   $00     ;  43/2b _____+_____
86         .byte   $00     ;  44/2c _____,_____
87         .byte   $00     ;  45/2d _____-_____
88         .byte   $00     ;  46/2e _____._____
89         .byte   $00     ;  47/2f _____/_____
90         .byte   $0C     ;  48/30 _____0_____
91         .byte   $0C     ;  49/31 _____1_____
92         .byte   $0C     ;  50/32 _____2_____
93         .byte   $0C     ;  51/33 _____3_____
94         .byte   $0C     ;  52/34 _____4_____
95         .byte   $0C     ;  53/35 _____5_____
96         .byte   $0C     ;  54/36 _____6_____
97         .byte   $0C     ;  55/37 _____7_____
98         .byte   $0C     ;  56/38 _____8_____
99         .byte   $0C     ;  57/39 _____9_____
100         .byte   $00     ;  58/3a _____:_____
101         .byte   $00     ;  59/3b _____;_____
102         .byte   $00     ;  60/3c _____<_____
103         .byte   $00     ;  61/3d _____=_____
104         .byte   $00     ;  62/3e _____>_____
105         .byte   $00     ;  63/3f _____?_____
106
107         .byte   $00     ;  64/40 _____@_____
108         .byte   $09     ;  65/41 _____a_____
109         .byte   $09     ;  66/42 _____b_____
110         .byte   $09     ;  67/43 _____c_____
111         .byte   $09     ;  68/44 _____d_____
112         .byte   $09     ;  69/45 _____e_____
113         .byte   $09     ;  70/46 _____f_____
114         .byte   $01     ;  71/47 _____g_____
115         .byte   $01     ;  72/48 _____h_____
116         .byte   $01     ;  73/49 _____i_____
117         .byte   $01     ;  74/4a _____j_____
118         .byte   $01     ;  75/4b _____k_____
119         .byte   $01     ;  76/4c _____l_____
120         .byte   $01     ;  77/4d _____m_____
121         .byte   $01     ;  78/4e _____n_____
122         .byte   $01     ;  79/4f _____o_____
123         .byte   $01     ;  80/50 _____p_____
124         .byte   $01     ;  81/51 _____q_____
125         .byte   $01     ;  82/52 _____r_____
126         .byte   $01     ;  83/53 _____s_____
127         .byte   $01     ;  84/54 _____t_____
128         .byte   $01     ;  85/55 _____u_____
129         .byte   $01     ;  86/56 _____v_____
130         .byte   $01     ;  87/57 _____w_____
131         .byte   $01     ;  88/58 _____x_____
132         .byte   $01     ;  89/59 _____y_____
133         .byte   $01     ;  90/5a _____z_____
134         .byte   $00     ;  91/5b _____[_____
135         .byte   $00     ;  92/5c _____\_____
136         .byte   $00     ;  93/5d _____]_____
137         .byte   $00     ;  94/5e _____^_____
138         .byte   $00     ;  95/5f _UNDERLINE_
139         .byte   $00     ;  96/60 _A`_grave__
140         .byte   $00     ;  97/61 _A'_acute__
141         .byte   $00     ;  98/62 _A^_circum_
142         .byte   $00     ;  99/63 _A~_tilde__
143         .byte   $00     ; 100/64 _A"_dieres_
144         .byte   $00     ; 101/65 _A__ring___
145         .byte   $00     ; 102/66 _AE________
146         .byte   $00     ; 103/67 _C,cedilla_
147         .byte   $00     ; 104/68 _E`_grave__
148         .byte   $00     ; 105/69 _E'_acute__
149         .byte   $00     ; 106/6a _E^_circum_
150         .byte   $00     ; 107/6b _E"_dieres_
151         .byte   $00     ; 108/6c _I`_grave__
152         .byte   $00     ; 109/6d _I'_acute__
153         .byte   $00     ; 110/6e _I^_circum_
154         .byte   $00     ; 111/6f _I"_dieres_
155         .byte   $00     ; 112/70 _D-_Eth_lr_
156         .byte   $00     ; 113/71 _N~_tilde__
157         .byte   $00     ; 114/72 _O`_grave__
158         .byte   $00     ; 115/73 _O'_acute__
159         .byte   $00     ; 116/74 _O^_circum_
160         .byte   $00     ; 117/75 _O~_tilde__
161         .byte   $00     ; 118/76 _O"_dieres_
162         .byte   $00     ; 119/77 __multiply_
163         .byte   $00     ; 120/78 _O/_slash__
164         .byte   $00     ; 121/79 _U`_grave__
165         .byte   $00     ; 122/7a _U'_acute__
166         .byte   $00     ; 123/7b _U^_circum_
167         .byte   $00     ; 124/7c _U"_dieres_
168         .byte   $00     ; 125/7d _Y'_acute__
169         .byte   $00     ; 126/7e _cap_thorn_
170         .byte   $00     ; 127/7f _Es-sed_B__
171
172         .byte   $00     ; 128/80 __bullet___
173         .byte   $00     ; 129/81 __v_line___
174         .byte   $00     ; 130/82 __h_line___
175         .byte   $00     ; 131/83 ___cross___
176         .byte   $00     ; 132/84 _tl_corner_
177         .byte   $00     ; 133/85 _tr_corner_
178         .byte   $00     ; 134/86 _bl_corner_
179         .byte   $00     ; 135/87 _br_corner_
180         .byte   $00     ; 136/88 ___l_tee___
181         .byte   $00     ; 137/89 ___r_tee___
182         .byte   $00     ; 138/8a ___t_tee___
183         .byte   $00     ; 139/8b ___b_tee___
184         .byte   $00     ; 140/8c ___heart___
185         .byte   $00     ; 141/8d __diamond__
186         .byte   $00     ; 142/8e ___club____
187         .byte   $00     ; 143/8f ___spade___
188         .byte   $00     ; 144/90 _s_circle__
189         .byte   $00     ; 145/91 __circle___
190         .byte   $00     ; 146/92 ___pound___
191         .byte   $10     ; 147/93 _CLS/check_
192         .byte   $00     ; 148/94 ____pi_____
193         .byte   $00     ; 149/95 ____+/-____
194         .byte   $00     ; 150/96 __divide___
195         .byte   $00     ; 151/97 __degree___
196         .byte   $00     ; 152/98 _c_checker_
197         .byte   $00     ; 153/99 _f_checker_
198         .byte   $00     ; 154/9a _solid_sq__
199         .byte   $00     ; 155/9b __cr_char__
200         .byte   $00     ; 156/9c _up_arrow__
201         .byte   $00     ; 157/9d _down_arro_
202         .byte   $00     ; 158/9e _left_arro_
203         .byte   $00     ; 159/9f _right_arr_
204         .byte   $00     ; 160/a0 _req space_
205         .byte   $00     ; 161/a1 _!_invertd_
206         .byte   $00     ; 162/a2 ___cent____
207         .byte   $00     ; 163/a3 ___pound___
208         .byte   $00     ; 164/a4 __currency_
209         .byte   $00     ; 165/a5 ____yen____
210         .byte   $00     ; 166/a6 _|_broken__
211         .byte   $00     ; 167/a7 __section__
212         .byte   $00     ; 168/a8 __umulaut__
213         .byte   $00     ; 169/a9 _copyright_
214         .byte   $00     ; 170/aa __fem_ord__
215         .byte   $00     ; 171/ab _l_ang_quo_
216         .byte   $00     ; 172/ac ____not____
217         .byte   $00     ; 173/ad _syl_hyphn_
218         .byte   $00     ; 174/ae _registerd_
219         .byte   $00     ; 175/af _overline__
220         .byte   $00     ; 176/b0 __degrees__
221         .byte   $00     ; 177/b1 ____+/-____
222         .byte   $00     ; 178/b2 _2_supersc_
223         .byte   $00     ; 179/b3 _3_supersc_
224         .byte   $00     ; 180/b4 ___acute___
225         .byte   $00     ; 181/b5 ____mu_____
226         .byte   $00     ; 182/b6 _paragraph_
227         .byte   $00     ; 183/b7 __mid_dot__
228         .byte   $00     ; 184/b8 __cedilla__
229         .byte   $00     ; 185/b9 _1_supersc_
230         .byte   $00     ; 186/ba __mas_ord__
231         .byte   $00     ; 187/bb _r_ang_quo_
232         .byte   $00     ; 188/bc ____1/4____
233         .byte   $00     ; 189/bd ____1/2____
234         .byte   $00     ; 190/be ____3/4____
235         .byte   $00     ; 191/bf _?_invertd_
236
237         .byte   $00     ; 192/c0 _____`_____
238         .byte   $0A     ; 193/c1 _____A_____
239         .byte   $0A     ; 194/c2 _____B_____
240         .byte   $0A     ; 195/c3 _____C_____
241         .byte   $0A     ; 196/c4 _____D_____
242         .byte   $0A     ; 197/c5 _____E_____
243         .byte   $0A     ; 198/c6 _____F_____
244         .byte   $02     ; 199/c7 _____G_____
245         .byte   $02     ; 200/c8 _____H_____
246         .byte   $02     ; 201/c9 _____I_____
247         .byte   $02     ; 202/ca _____J_____
248         .byte   $02     ; 203/cb _____K_____
249         .byte   $02     ; 204/cc _____L_____
250         .byte   $02     ; 205/cd _____M_____
251         .byte   $02     ; 206/ce _____N_____
252         .byte   $02     ; 207/cf _____O_____
253         .byte   $02     ; 208/d0 _____P_____
254         .byte   $02     ; 209/d1 _____Q_____
255         .byte   $02     ; 210/d2 _____R_____
256         .byte   $02     ; 211/d3 _____S_____
257         .byte   $02     ; 212/d4 _____T_____
258         .byte   $02     ; 213/d5 _____U_____
259         .byte   $02     ; 214/d6 _____V_____
260         .byte   $02     ; 215/d7 _____W_____
261         .byte   $02     ; 216/d8 _____X_____
262         .byte   $02     ; 217/d9 _____Y_____
263         .byte   $02     ; 218/da _____Z_____
264         .byte   $00     ; 219/db _____{_____
265         .byte   $00     ; 220/dc _____|_____
266         .byte   $00     ; 221/dd _____}_____
267         .byte   $00     ; 222/de _____~_____
268         .byte   $00     ; 223/df ___HOUSE___
269         .byte   $00     ; 224/e0 _a`_grave__
270         .byte   $00     ; 225/e1 _a'_acute__
271         .byte   $00     ; 226/e2 _a^_circum_
272         .byte   $00     ; 227/e3 _a~_tilde__
273         .byte   $00     ; 228/e4 _a"_dieres_
274         .byte   $00     ; 229/e5 _a__ring___
275         .byte   $00     ; 230/e6 _ae________
276         .byte   $00     ; 231/e7 _c,cedilla_
277         .byte   $00     ; 232/e8 _e`_grave__
278         .byte   $00     ; 233/e9 _e'_acute__
279         .byte   $00     ; 234/ea _e^_circum_
280         .byte   $00     ; 235/eb _e"_dieres_
281         .byte   $00     ; 236/ec _i`_grave__
282         .byte   $00     ; 237/ed _i'_acute__
283         .byte   $00     ; 238/ee _i^_circum_
284         .byte   $00     ; 239/ef _i"_dieres_
285         .byte   $00     ; 240/f0 _o^x_Eth_s_
286         .byte   $00     ; 241/f1 _n~_tilda__
287         .byte   $00     ; 242/f2 _o`_grave__
288         .byte   $00     ; 243/f3 _o'_acute__
289         .byte   $00     ; 244/f4 _o^_circum_
290         .byte   $00     ; 245/f5 _o~_tilde__
291         .byte   $00     ; 246/f6 _o"_dieres_
292         .byte   $00     ; 247/f7 __divide___
293         .byte   $00     ; 248/f8 _o/_slash__
294         .byte   $00     ; 249/f9 _u`_grave__
295         .byte   $00     ; 250/fa _u'_acute__
296         .byte   $00     ; 251/fb _u^_circum_
297         .byte   $00     ; 252/fc _u"_dieres_
298         .byte   $00     ; 253/fd _y'_acute__
299         .byte   $00     ; 254/fe _sm_thorn__
300         .byte   $00     ; 255/ff _y"_dieres_
301