Implemented charmap stack
New commands: .PUSHCHARMAP: will push the current charmap state into an internal stack .POPCHARMAP: will restore the current charmap to the last pushed charmap Details: The push and pop facilities are implemented directly inside the tgttrans.h, to facilitate its reuse on the C compiler.
This commit is contained in:
committed by
Oliver Schmidt
parent
ffc30c0c6e
commit
c915b5d7f3
@@ -1568,6 +1568,19 @@ static void DoPageLength (void)
|
||||
|
||||
|
||||
|
||||
static void DoPopCharmap (void)
|
||||
/* Restore a charmap */
|
||||
{
|
||||
if (TgtTranslateStackIsEmpty ()) {
|
||||
ErrorSkip ("Charmap stack is empty");
|
||||
return;
|
||||
}
|
||||
|
||||
TgtTranslatePop ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void DoPopCPU (void)
|
||||
/* Pop an old CPU setting from the CPU stack */
|
||||
{
|
||||
@@ -1657,6 +1670,16 @@ static void DoPSC02 (void)
|
||||
|
||||
|
||||
|
||||
static void DoPushCharmap (void)
|
||||
/* Save the current charmap */
|
||||
{
|
||||
if (!TgtTranslatePush ()) {
|
||||
ErrorSkip ("Charmap stack overflow");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void DoPushCPU (void)
|
||||
/* Push the current CPU setting onto the CPU stack */
|
||||
{
|
||||
@@ -2101,10 +2124,12 @@ static CtrlDesc CtrlCmdTab [] = {
|
||||
{ ccNone, DoUnexpected }, /* .PARAMCOUNT */
|
||||
{ ccNone, DoPC02 },
|
||||
{ ccNone, DoPDTV },
|
||||
{ ccNone, DoPopCharmap },
|
||||
{ ccNone, DoPopCPU },
|
||||
{ ccNone, DoPopSeg },
|
||||
{ ccNone, DoProc },
|
||||
{ ccNone, DoPSC02 },
|
||||
{ ccNone, DoPushCharmap },
|
||||
{ ccNone, DoPushCPU },
|
||||
{ ccNone, DoPushSeg },
|
||||
{ ccNone, DoUnexpected }, /* .REFERENCED */
|
||||
@@ -2183,4 +2208,7 @@ void CheckPseudo (void)
|
||||
if (!IS_IsEmpty (&CPUStack)) {
|
||||
Warning (1, "CPU stack is not empty");
|
||||
}
|
||||
if (!TgtTranslateStackIsEmpty ()) {
|
||||
Warning (1, "Charmap stack is not empty");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user