]> git.sur5r.net Git - cc65/blob - libsrc/nes/ctype.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / nes / 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         .export         __ctype
37
38 __ctype:
39
40 .repeat 2       ; 2 times for normal and inverted
41
42         .byte   $10     ;   0/00 ___ctrl_@___
43         .byte   $10     ;   1/01 ___ctrl_A___
44         .byte   $10     ;   2/02 ___ctrl_B___
45         .byte   $10     ;   3/03 ___ctrl_C___
46         .byte   $10     ;   4/04 ___ctrl_D___
47         .byte   $10     ;   5/05 ___ctrl_E___
48         .byte   $10     ;   6/06 ___ctrl_F___
49         .byte   $10     ;   7/07 ___ctrl_G___
50         .byte   $10     ;   8/08 ___ctrl_H___
51         .byte   $D0     ;   9/09 ___ctrl_I___
52         .byte   $50     ;  10/0a ___ctrl_J___
53         .byte   $50     ;  11/0b ___ctrl_K___
54         .byte   $50     ;  12/0c ___ctrl_L___
55         .byte   $50     ;  13/0d ___ctrl_M___
56         .byte   $10     ;  14/0e ___ctrl_N___
57         .byte   $10     ;  15/0f ___ctrl_O___
58         .byte   $10     ;  16/10 ___ctrl_P___
59         .byte   $10     ;  17/11 ___ctrl_Q___
60         .byte   $10     ;  18/12 ___ctrl_R___
61         .byte   $10     ;  19/13 ___ctrl_S___
62         .byte   $10     ;  20/14 ___ctrl_T___
63         .byte   $10     ;  21/15 ___ctrl_U___
64         .byte   $10     ;  22/16 ___ctrl_V___
65         .byte   $10     ;  23/17 ___ctrl_W___
66         .byte   $10     ;  24/18 ___ctrl_X___
67         .byte   $10     ;  25/19 ___ctrl_Y___
68         .byte   $10     ;  26/1a ___ctrl_Z___
69         .byte   $10     ;  27/1b ___ctrl_[___
70         .byte   $10     ;  28/1c ___ctrl_\___
71         .byte   $10     ;  29/1d ___ctrl_]___
72         .byte   $10     ;  30/1e ___ctrl_^___
73         .byte   $10     ;  31/1f ___ctrl_____
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   $0A     ;  65/41 _____A_____
109         .byte   $0A     ;  66/42 _____B_____
110         .byte   $0A     ;  67/43 _____C_____
111         .byte   $0A     ;  68/44 _____D_____
112         .byte   $0A     ;  69/45 _____E_____
113         .byte   $0A     ;  70/46 _____F_____
114         .byte   $02     ;  71/47 _____G_____
115         .byte   $02     ;  72/48 _____H_____
116         .byte   $02     ;  73/49 _____I_____
117         .byte   $02     ;  74/4a _____J_____
118         .byte   $02     ;  75/4b _____K_____
119         .byte   $02     ;  76/4c _____L_____
120         .byte   $02     ;  77/4d _____M_____
121         .byte   $02     ;  78/4e _____N_____
122         .byte   $02     ;  79/4f _____O_____
123         .byte   $02     ;  80/50 _____P_____
124         .byte   $02     ;  81/51 _____Q_____
125         .byte   $02     ;  82/52 _____R_____
126         .byte   $02     ;  83/53 _____S_____
127         .byte   $02     ;  84/54 _____T_____
128         .byte   $02     ;  85/55 _____U_____
129         .byte   $02     ;  86/56 _____V_____
130         .byte   $02     ;  87/57 _____W_____
131         .byte   $02     ;  88/58 _____X_____
132         .byte   $02     ;  89/59 _____Y_____
133         .byte   $02     ;  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 ___grave___
140         .byte   $09     ;  97/61 _____a_____
141         .byte   $09     ;  98/62 _____b_____
142         .byte   $09     ;  99/63 _____c_____
143         .byte   $09     ; 100/64 _____d_____
144         .byte   $09     ; 101/65 _____e_____
145         .byte   $09     ; 102/66 _____f_____
146         .byte   $01     ; 103/67 _____g_____
147         .byte   $01     ; 104/68 _____h_____
148         .byte   $01     ; 105/69 _____i_____
149         .byte   $01     ; 106/6a _____j_____
150         .byte   $01     ; 107/6b _____k_____
151         .byte   $01     ; 108/6c _____l_____
152         .byte   $01     ; 109/6d _____m_____
153         .byte   $01     ; 110/6e _____n_____
154         .byte   $01     ; 111/6f _____o_____
155         .byte   $01     ; 112/70 _____p_____
156         .byte   $01     ; 113/71 _____q_____
157         .byte   $01     ; 114/72 _____r_____
158         .byte   $01     ; 115/73 _____s_____
159         .byte   $01     ; 116/74 _____t_____
160         .byte   $01     ; 117/75 _____u_____
161         .byte   $01     ; 118/76 _____v_____
162         .byte   $01     ; 119/77 _____w_____
163         .byte   $01     ; 120/78 _____x_____
164         .byte   $01     ; 121/79 _____y_____
165         .byte   $01     ; 122/7a _____z_____
166         .byte   $00     ; 123/7b _____{_____
167         .byte   $00     ; 124/7c _____|_____
168         .byte   $00     ; 125/7d _____}_____
169         .byte   $00     ; 126/7e _____~_____
170         .byte   $40     ; 127/7f ____DEL____
171
172 .endrepeat