c++.dos.16-bits - TSR and stack
- Zbynìk Jaro¹ (33/33) Aug 14 2001 Hello
- Walter (7/40) Aug 14 2001 You'll need to resort to inline assembler:
Hello
How I have to change stack between a TSR and interrupt program?
I try to use this code...
void interrupt newTimer()
{
....
(*oldTimer)();
if (running == 0)
{
running = 1;
disable();
originalSP = _SP;
originalSS = _SS;
_SP = myStack;
_SS = mySS;
enable();
...
....
disable();
_SP = originalSP;
_SS = originalSS;
enable();
running = 0;
}
}
but the sc compiler show the error message
C:\>sc c:\projekty\dos\pokus1.cpp -ms -cpp -d
intss = _SS;
^
c:\projekty\dos\pokus1.cpp(137) : Error: undefined identifier '_SS'
--- errorlevel 1
C:\>
Thanks Zbynek
Aug 14 2001
You'll need to resort to inline assembler:
_asm
{
mov AX,originalSS
mov SS,AX
}
Zbynìk Jaro¹ wrote in message <9lao6g$1itc$1 digitaldaemon.com>...
Hello
How I have to change stack between a TSR and interrupt program?
I try to use this code...
void interrupt newTimer()
{
....
(*oldTimer)();
if (running == 0)
{
running = 1;
disable();
originalSP = _SP;
originalSS = _SS;
_SP = myStack;
_SS = mySS;
enable();
...
....
disable();
_SP = originalSP;
_SS = originalSS;
enable();
running = 0;
}
}
but the sc compiler show the error message
C:\>sc c:\projekty\dos\pokus1.cpp -ms -cpp -d
intss = _SS;
^
c:\projekty\dos\pokus1.cpp(137) : Error: undefined identifier '_SS'
--- errorlevel 1
C:\>
Thanks Zbynek
Aug 14 2001








"Walter" <walter digitalmars.com>