]> git.sur5r.net Git - cc65/blob - libsrc/atari/ctype.s
Added SER_ prefix. Whitespace cleanup
[cc65] / libsrc / atari / ctype.s
1 ;
2 ; Ullrich von Bassewitz, 02.06.1998
3 ;
4 ; Character specification table.
5 ;
6 ; adapted to Atari by Christian Groessler, June 2000
7 ;
8
9 ; The tables are readonly, put them into the rodata segment
10
11 .rodata
12
13 ; The following 256 byte wide table specifies attributes for the isxxx type
14 ; of functions. Doing it by a table means some overhead in space, but it
15 ; has major advantages:
16 ;
17 ;   * It is fast. If it were'nt for the slow parameter passing of cc65, one
18 ;     could even define macros for the isxxx functions (this is usually
19 ;     done on other platforms).
20 ;
21 ;   * It is highly portable. The only unportable part is the table itself,
22 ;     all real code goes into the common library.
23 ;
24 ;   * We save some code in the isxxx functions.
25 ;
26 ;
27 ; Bit assignments:
28 ;
29 ;   0 - Lower case char
30 ;   1 - Upper case char
31 ;   2 - Numeric digit
32 ;   3 - Hex digit (both, lower and upper)
33 ;   4 - Control character
34 ;   5 - The space character itself
35 ;   6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v')
36 ;   7 - Space or tab character
37
38         .export         __ctype
39
40 __ctype:
41         .byte   $00     ;   0/00 ___heart____
42         .byte   $00     ;   1/01 ___l_tee____
43         .byte   $00     ;   2/02 ___ctrl_B___
44         .byte   $00     ;   3/03 ___ctrl_C___
45         .byte   $00     ;   4/04 ___r_tee____
46         .byte   $00     ;   5/05 ___ctrl_E___
47         .byte   $00     ;   6/06 ___ctrl_F___
48         .byte   $00     ;   7/07 ___ctrl_G___
49         .byte   $00     ;   8/08 ___ctrl_H___
50         .byte   $00     ;   9/09 ___ctrl_I___
51         .byte   $00     ;  10/0a ___ctrl_J___
52         .byte   $00     ;  11/0b ___ctrl_K___
53         .byte   $00     ;  12/0c ___ctrl_L___
54         .byte   $00     ;  13/0d ___ctrl_M___
55         .byte   $00     ;  14/0e ___ctrl_N___
56         .byte   $00     ;  15/0f ___ctrl_O___
57         .byte   $00     ;  16/10 ____club____
58         .byte   $00     ;  17/11 ___ctrl_Q___
59         .byte   $00     ;  18/12 ___h_line___
60         .byte   $00     ;  19/13 ___ctrl_S___
61         .byte   $00     ;  20/14 ____ball____
62         .byte   $00     ;  21/15 ___ctrl_U___
63         .byte   $00     ;  22/16 ___ctrl_V___
64         .byte   $00     ;  23/17 ___t_tee____
65         .byte   $00     ;  24/18 ___b_tee____
66         .byte   $00     ;  25/19 ___ctrl_Y___
67         .byte   $00     ;  26/1a ___ctrl_Z___
68         .byte   $10     ;  27/1b ____ESC_____
69         .byte   $10     ;  28/1c ___crsr_up__
70         .byte   $10     ;  29/1d ___crsr_dn__
71         .byte   $10     ;  30/1e ___crsr_lf__
72         .byte   $10     ;  31/1f ___crsr_rg__
73         .byte   $A0     ;  32/20 ___SPACE___
74         .byte   $00     ;  33/21 _____!_____
75         .byte   $00     ;  34/22 _____"_____
76         .byte   $00     ;  35/23 _____#_____
77         .byte   $00     ;  36/24 _____$_____
78         .byte   $00     ;  37/25 _____%_____
79         .byte   $00     ;  38/26 _____&_____
80         .byte   $00     ;  39/27 _____'_____
81         .byte   $00     ;  40/28 _____(_____
82         .byte   $00     ;  41/29 _____)_____
83         .byte   $00     ;  42/2a _____*_____
84         .byte   $00     ;  43/2b _____+_____
85         .byte   $00     ;  44/2c _____,_____
86         .byte   $00     ;  45/2d _____-_____
87         .byte   $00     ;  46/2e _____._____
88         .byte   $00     ;  47/2f _____/_____
89         .byte   $0C     ;  48/30 _____0_____
90         .byte   $0C     ;  49/31 _____1_____
91         .byte   $0C     ;  50/32 _____2_____
92         .byte   $0C     ;  51/33 _____3_____
93         .byte   $0C     ;  52/34 _____4_____
94         .byte   $0C     ;  53/35 _____5_____
95         .byte   $0C     ;  54/36 _____6_____
96         .byte   $0C     ;  55/37 _____7_____
97         .byte   $0C     ;  56/38 _____8_____
98         .byte   $0C     ;  57/39 _____9_____
99         .byte   $00     ;  58/3a _____:_____
100         .byte   $00     ;  59/3b _____;_____
101         .byte   $00     ;  60/3c _____<_____
102         .byte   $00     ;  61/3d _____=_____
103         .byte   $00     ;  62/3e _____>_____
104         .byte   $00     ;  63/3f _____?_____
105
106         .byte   $00     ;  64/40 _____@_____
107         .byte   $0A     ;  65/41 _____A_____
108         .byte   $0A     ;  66/42 _____B_____
109         .byte   $0A     ;  67/43 _____C_____
110         .byte   $0A     ;  68/44 _____D_____
111         .byte   $0A     ;  69/45 _____E_____
112         .byte   $0A     ;  70/46 _____F_____
113         .byte   $02     ;  71/47 _____G_____
114         .byte   $02     ;  72/48 _____H_____
115         .byte   $02     ;  73/49 _____I_____
116         .byte   $02     ;  74/4a _____J_____
117         .byte   $02     ;  75/4b _____K_____
118         .byte   $02     ;  76/4c _____L_____
119         .byte   $02     ;  77/4d _____M_____
120         .byte   $02     ;  78/4e _____N_____
121         .byte   $02     ;  79/4f _____O_____
122         .byte   $02     ;  80/50 _____P_____
123         .byte   $02     ;  81/51 _____Q_____
124         .byte   $02     ;  82/52 _____R_____
125         .byte   $02     ;  83/53 _____S_____
126         .byte   $02     ;  84/54 _____T_____
127         .byte   $02     ;  85/55 _____U_____
128         .byte   $02     ;  86/56 _____V_____
129         .byte   $02     ;  87/57 _____W_____
130         .byte   $02     ;  88/58 _____X_____
131         .byte   $02     ;  89/59 _____Y_____
132         .byte   $02     ;  90/5a _____Z_____
133         .byte   $00     ;  91/5b _____[_____
134         .byte   $00     ;  92/5c _____\_____
135         .byte   $00     ;  93/5d _____]_____
136         .byte   $00     ;  94/5e _____^_____
137         .byte   $00     ;  95/5f _UNDERLINE_
138         .byte   $00     ;  96/60 __diamond__
139         .byte   $09     ;  97/61 _____a_____
140         .byte   $09     ;  98/62 _____b_____
141         .byte   $09     ;  99/63 _____c_____
142         .byte   $09     ; 100/64 _____d_____
143         .byte   $09     ; 101/65 _____e_____
144         .byte   $09     ; 102/66 _____f_____
145         .byte   $01     ; 103/67 _____g_____
146         .byte   $01     ; 104/68 _____h_____
147         .byte   $01     ; 105/69 _____i_____
148         .byte   $01     ; 106/6a _____j_____
149         .byte   $01     ; 107/6b _____k_____
150         .byte   $01     ; 108/6c _____l_____
151         .byte   $01     ; 109/6d _____m_____
152         .byte   $01     ; 110/6e _____n_____
153         .byte   $01     ; 111/6f _____o_____
154         .byte   $01     ; 112/70 _____p_____
155         .byte   $01     ; 113/71 _____q_____
156         .byte   $01     ; 114/72 _____r_____
157         .byte   $01     ; 115/73 _____s_____
158         .byte   $01     ; 116/74 _____t_____
159         .byte   $01     ; 117/75 _____u_____
160         .byte   $01     ; 118/76 _____v_____
161         .byte   $01     ; 119/77 _____w_____
162         .byte   $01     ; 120/78 _____x_____
163         .byte   $01     ; 121/79 _____y_____
164         .byte   $01     ; 122/7a _____z_____
165         .byte   $00     ; 123/7b ___spade___
166         .byte   $00     ; 124/7c __v_line___
167         .byte   $10     ; 125/7d __CLRSCR___
168         .byte   $D0     ; 126/7e __backtab__
169         .byte   $D0     ; 127/7f ____tab____
170
171         .byte   $00     ; 128/80 _inv_heart___
172         .byte   $00     ; 129/81 _inv_l_tee___
173         .byte   $00     ; 130/82 _inv_ctrl_B__
174         .byte   $00     ; 131/83 _inv_ctrl_C__
175         .byte   $00     ; 132/84 _inv_r_tee___
176         .byte   $00     ; 133/85 _inv_ctrl_E__
177         .byte   $00     ; 134/86 _inv_ctrl_F__
178         .byte   $00     ; 135/87 _inv_ctrl_G__
179         .byte   $00     ; 136/88 _inv_ctrl_H__
180         .byte   $00     ; 137/89 _inv_ctrl_I__
181         .byte   $00     ; 138/8a _inv_ctrl_J__
182         .byte   $00     ; 139/8b _inv_ctrl_K__
183         .byte   $00     ; 140/8c _inv_ctrl_L__
184         .byte   $00     ; 141/8d _inv_ctrl_M__
185         .byte   $00     ; 142/8e _inv_ctrl_N__
186         .byte   $00     ; 143/8f _inv_ctrl_O__
187         .byte   $00     ; 144/90 __inv__club__
188         .byte   $00     ; 145/91 _inv_ctrl_Q__
189         .byte   $00     ; 146/92 _inv_h_line__
190         .byte   $00     ; 147/93 _inv_ctrl_S__
191         .byte   $00     ; 148/94 __inv__ball__
192         .byte   $00     ; 149/95 _inv_ctrl_U__
193         .byte   $00     ; 150/96 _inv_ctrl_V__
194         .byte   $00     ; 151/97 __inv_t_tee__
195         .byte   $00     ; 152/98 __inv_b_tee__
196         .byte   $00     ; 153/99 _inv_ctrl_Y__
197         .byte   $00     ; 154/9a _inv_ctrl_Z__
198         .byte   $50     ; 155/9b _____EOL_____
199         .byte   $10     ; 156/9c ___CLRLINE___
200         .byte   $10     ; 157/9d ___INSLINE___
201         .byte   $10     ; 158/9e ____CLRTAB___
202         .byte   $10     ; 159/9f ____INSTAB___
203         .byte   $A0     ; 160/a0 __inv_SPACE__
204         .byte   $00     ; 161/a1 ___inv_!_____
205         .byte   $00     ; 162/a2 ___inv_"_____
206         .byte   $00     ; 163/a3 ___inv_#_____
207         .byte   $00     ; 164/a4 ___inv_$_____
208         .byte   $00     ; 165/a5 ___inv_%_____
209         .byte   $00     ; 166/a6 ___inv_&_____
210         .byte   $00     ; 167/a7 ___inv_'_____
211         .byte   $00     ; 168/a8 ___inv_(_____
212         .byte   $00     ; 169/a9 ___inv_)_____
213         .byte   $00     ; 170/aa ___inv_*_____
214         .byte   $00     ; 171/ab ___inv_+_____
215         .byte   $00     ; 172/ac ___inv_,_____
216         .byte   $00     ; 173/ad ___inv_-_____
217         .byte   $00     ; 174/ae ___inv_._____
218         .byte   $00     ; 175/af ___inv_/_____
219         .byte   $0C     ; 176/b0 ___inv_0_____
220         .byte   $0C     ; 177/b1 ___inv_1_____
221         .byte   $0C     ; 178/b2 ___inv_2_____
222         .byte   $0C     ; 179/b3 ___inv_3_____
223         .byte   $0C     ; 180/b4 ___inv_4_____
224         .byte   $0C     ; 181/b5 ___inv_5_____
225         .byte   $0C     ; 182/b6 ___inv_6_____
226         .byte   $0C     ; 183/b7 ___inv_7_____
227         .byte   $0C     ; 184/b8 ___inv_8_____
228         .byte   $0C     ; 185/b9 ___inv_9_____
229         .byte   $00     ; 186/ba ___inv_:_____
230         .byte   $00     ; 187/bb ___inv_;_____
231         .byte   $00     ; 188/bc ___inv_<_____
232         .byte   $00     ; 189/bd ___inv_=_____
233         .byte   $00     ; 190/be ___inv_>_____
234         .byte   $00     ; 191/bf ___inv_?_____
235
236         .byte   $00     ; 192/c0 ___inv_@_____
237         .byte   $0A     ; 193/c1 ___inv_A_____
238         .byte   $0A     ; 194/c2 ___inv_B_____
239         .byte   $0A     ; 195/c3 ___inv_C_____
240         .byte   $0A     ; 196/c4 ___inv_D_____
241         .byte   $0A     ; 197/c5 ___inv_E_____
242         .byte   $0A     ; 198/c6 ___inv_F_____
243         .byte   $02     ; 199/c7 ___inv_G_____
244         .byte   $02     ; 200/c8 ___inv_H_____
245         .byte   $02     ; 201/c9 ___inv_I_____
246         .byte   $02     ; 202/ca ___inv_J_____
247         .byte   $02     ; 203/cb ___inv_K_____
248         .byte   $02     ; 204/cc ___inv_L_____
249         .byte   $02     ; 205/cd ___inv_M_____
250         .byte   $02     ; 206/ce ___inv_N_____
251         .byte   $02     ; 207/cf ___inv_O_____
252         .byte   $02     ; 208/d0 ___inv_P_____
253         .byte   $02     ; 209/d1 ___inv_Q_____
254         .byte   $02     ; 210/d2 ___inv_R_____
255         .byte   $02     ; 211/d3 ___inv_S_____
256         .byte   $02     ; 212/d4 ___inv_T_____
257         .byte   $02     ; 213/d5 ___inv_U_____
258         .byte   $02     ; 214/d6 ___inv_V_____
259         .byte   $02     ; 215/d7 ___inv_W_____
260         .byte   $02     ; 216/d8 ___inv_X_____
261         .byte   $02     ; 217/d9 ___inv_Y_____
262         .byte   $02     ; 218/da ___inv_Z_____
263         .byte   $00     ; 219/db ___inv_[_____
264         .byte   $00     ; 220/dc ___inv_\_____
265         .byte   $00     ; 221/dd ___inv_]_____
266         .byte   $00     ; 222/de ___inv_^_____
267         .byte   $00     ; 223/df _inv_UNDRLIN_
268         .byte   $00     ; 224/e0 _inv_diamond_
269         .byte   $09     ; 225/e1 ___inv_a_____
270         .byte   $09     ; 226/e2 ___inv_b_____
271         .byte   $09     ; 227/e3 ___inv_c_____
272         .byte   $09     ; 228/e4 ___inv_d_____
273         .byte   $09     ; 229/e5 ___inv_e_____
274         .byte   $09     ; 230/e6 ___inv_f_____
275         .byte   $01     ; 231/e7 ___inv_g_____
276         .byte   $01     ; 232/e8 ___inv_h_____
277         .byte   $01     ; 233/e9 ___inv_i_____
278         .byte   $01     ; 234/ea ___inv_j_____
279         .byte   $01     ; 235/eb ___inv_k_____
280         .byte   $01     ; 236/ec ___inv_l_____
281         .byte   $01     ; 237/ed ___inv_m_____
282         .byte   $01     ; 238/ee ___inv_n_____
283         .byte   $01     ; 239/ef ___inv_o_____
284         .byte   $01     ; 240/f0 ___inv_p_____
285         .byte   $01     ; 241/f1 ___inv_q_____
286         .byte   $01     ; 242/f2 ___inv_r_____
287         .byte   $01     ; 243/f3 ___inv_s_____
288         .byte   $01     ; 244/f4 ___inv_t_____
289         .byte   $01     ; 245/f5 ___inv_u_____
290         .byte   $01     ; 246/f6 ___inv_v_____
291         .byte   $01     ; 247/f7 ___inv_w_____
292         .byte   $01     ; 248/f8 ___inv_x_____
293         .byte   $01     ; 249/f9 ___inv_y_____
294         .byte   $01     ; 250/fa ___inv_z_____
295         .byte   $00     ; 251/fb __inv_spade__
296         .byte   $00     ; 252/fc __inv_v_line_
297         .byte   $10     ; 253/fd ____BEEP_____
298         .byte   $10     ; 254/fe ____DELBS____
299         .byte   $10     ; 255/ff ___INSERT____
300
301