1	charmap "<NULL>", $00
2	charmap "A", $10
3	charmap "B", $20
4	charmap "C", $30
5	charmap "Bold", $88
6
7SECTION "test", ROM0
8
9S EQUS "XBold<NULL>ABC"
10
11	assert CHARLEN("{S}") == 6
12	println CHARSUB("{S}", 2)
13	assert !STRCMP(CHARSUB("{S}", 2), "Bold")
14	assert CHARSUB("{S}", -5) == CHARSUB("{S}", CHARLEN("{S}") + 1 - 5)
15	assert CHARSUB("{S}", 2) == "Bold" && "Bold" == $88
16	assert CHARSUB("{S}", 1) == $58 ; ASCII "X"
17	db "{S}"
18
19	newcharmap ascii
20
21	assert CHARLEN("{S}") == 14
22	println CHARSUB("{S}", 2)
23	assert !STRCMP(CHARSUB("{S}", 2), "B")
24	assert CHARSUB("{S}", -5) == CHARSUB("{S}", CHARLEN("{S}") + 1 - 5)
25	assert CHARSUB("{S}", 2) == "B" && "B" == $42 ; ASCII "B"
26	assert CHARSUB("{S}", 1) == $58 ; ASCII "X"
27	db "{S}"
28