From: cuz Date: Mon, 18 Feb 2002 08:39:41 +0000 (+0000) Subject: Document #pragma charmap X-Git-Tag: V2.12.0~2452 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f0dae93d42f5ae26bc032eed672ddcfb924b4b2b;p=cc65 Document #pragma charmap git-svn-id: svn://svn.cc65.org/cc65/trunk@1161 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/doc/cc65.sgml b/doc/cc65.sgml index 1c180a8ae..fb4778d48 100644 --- a/doc/cc65.sgml +++ b/doc/cc65.sgml @@ -593,7 +593,41 @@ generation and other stuff. Example: - #pragma bssseg ("MyBSS") + #pragma bssseg ("MyBSS") + + + +#pragma charmap (<index>, <code>)

+ + Each literal string and each literal character in the source is translated + by use of a translation table. This translation table is preset when the + compiler is started depending on the target system, for example to map + ISO-8859-1 characters into PETSCII if the target is a commodore machine. + + This pragma allows to change entries in the translation table, so the + translation for individual characters, or even the complete table may be + adjusted. + + Both arguments are assumed to be unsigned characters with a valid range of + 1-255. + + Beware of two pitfalls: + + + The character index is actually the code of the character in the + C source, so character mappings do always depend on the source + character set. This means that While it is possible to use character literals as indices, the + result may be somewhat unexpected, since character literals are + itself translated. For this reason I would suggest to avoid + character literals and use numeric character codes instead. + + + Example: + + /* Use a space wherever an 'a' occurs in ISO-8859-1 source */ + #pragma charmap (0x61, 0x20);