1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-14 00:32:08 +00:00

Added .charmap

git-svn-id: svn://svn.cc65.org/cc65/trunk@1163 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-02-18 09:11:57 +00:00
parent 3b5808788b
commit 208090ea36
3 changed files with 38 additions and 4 deletions

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2000 Ullrich von Bassewitz */
/* (C) 1998-2002 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
@ -373,6 +373,37 @@ static void DoCase (void)
static void DoCharMap (void)
/* Allow custome character mappings */
{
long Index;
long Code;
/* Read the index as numerical value */
Index = ConstExpression ();
if (Index < 1 || Index > 255) {
/* Value out of range */
ErrorSkip (ERR_RANGE);
return;
}
/* Comma follows */
ConsumeComma ();
/* Read the character code */
Code = ConstExpression ();
if (Code < 1 || Code > 255) {
/* Value out of range */
ErrorSkip (ERR_RANGE);
return;
}
/* Set the character translation */
TgtTranslateSet ((unsigned) Index, (unsigned char) Code);
}
static void DoCode (void)
/* Switch to the code segment */
{
@ -1317,6 +1348,7 @@ static CtrlDesc CtrlCmdTab [] = {
{ ccNone, DoBss },
{ ccNone, DoByte },
{ ccNone, DoCase },
{ ccNone, DoCharMap },
{ ccNone, DoCode },
{ ccNone, DoUnexpected, }, /* .CONCAT */
{ ccNone, DoConDes },

View File

@ -133,6 +133,7 @@ struct DotKeyword {
{ ".BYT", TOK_BYTE },
{ ".BYTE", TOK_BYTE },
{ ".CASE", TOK_CASE },
{ ".CHARMAP", TOK_CHARMAP },
{ ".CODE", TOK_CODE },
{ ".CONCAT", TOK_CONCAT },
{ ".CONDES", TOK_CONDES },

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2000 Ullrich von Bassewitz */
/* (C) 1998-2002 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
@ -118,9 +118,10 @@ enum Token {
TOK_BLANK,
TOK_BSS,
TOK_BYTE,
TOK_CASE,
TOK_CASE,
TOK_CHARMAP,
TOK_CODE,
TOK_CONCAT,
TOK_CONCAT,
TOK_CONDES,
TOK_CONST,
TOK_CONSTRUCTOR,