1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-16 18:08:04 +00:00
cc65/asminc/ctypetable.inc

49 lines
1.5 KiB
PHP
Raw Normal View History

2020-01-02 17:57:03 +00:00
; ctypetable.inc
;
; This file is part of
; cc65 - a freeware C compiler for 6502 based systems
;
2020-02-02 17:21:25 +00:00
; https://cc65.github.io
2020-01-02 17:57:03 +00:00
;
; See "LICENSE" file for legal information.
;
; Data covering all possible combinations of character flags for target specific definition
;
2020-02-02 17:21:25 +00:00
.include "ctype.inc"
.export __ctype
2020-01-02 17:57:03 +00:00
2020-01-05 14:57:44 +00:00
; Table definition covering all possible ctype combinations
2020-01-02 17:57:03 +00:00
.rodata
__ctype:
2020-02-02 17:21:25 +00:00
ct_none: .byte CT_NONE
ct_lower: .byte CT_LOWER
ct_upper: .byte CT_UPPER
ct_digit_xdigit: .byte CT_DIGIT | CT_XDIGIT
ct_lower_xdigit: .byte CT_LOWER | CT_XDIGIT
ct_upper_xdigit: .byte CT_UPPER | CT_XDIGIT
ct_ctrl: .byte CT_CTRL
ct_ws: .byte CT_OTHER_WS
ct_ctrl_ws: .byte CT_CTRL | CT_OTHER_WS
ct_space_spacetab: .byte CT_SPACE | CT_SPACE_TAB
ct_ctrl_ws_spacetab: .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB
2020-01-02 17:57:03 +00:00
; build indices out of the table above:
2020-02-02 17:21:25 +00:00
CT_NONE_IDX = ct_none - __ctype
CT_LOWER_IDX = ct_lower - __ctype
CT_UPPER_IDX = ct_upper - __ctype
CT_DIGIT_XDIGIT_IDX = ct_digit_xdigit - __ctype
CT_LOWER_XDIGIT_IDX = ct_lower_xdigit - __ctype
CT_UPPER_XDIGIT_IDX = ct_upper_xdigit - __ctype
CT_CTRL_IDX = ct_ctrl - __ctype
CT_WS_IDX = ct_ws - __ctype
CT_CTRL_WS_IDX = ct_ctrl_ws - __ctype
CT_SPACE_SPACETAB_IDX = ct_space_spacetab - __ctype
2020-01-02 17:57:03 +00:00
CT_CTRL_WS_SPACETAB_IDX = ct_ctrl_ws_spacetab - __ctype
.macro ct_mix lower, upper
2020-02-02 17:21:25 +00:00
.byte ((lower) & $0F) | ((upper) << 4)
2020-01-02 17:57:03 +00:00
.endmacro