But I have yet to figure out exactly the right way of declaring these
variables. I've tried:
asm {
var1: dw 0
var2 dw 0
}
neither of which get past an assembler error.
Any ideas?
Thanks!!!
Chris
--
First of all, if you are doing this in C/C++, then it is far easier to
declare the variables outside of the inline assembly blocks. Second, you
may not put lables inside inline assembly blocks.
Try something like this:
void func1(void)
{
int var1,var2;
asm{
mov ax,[var1] // access var1
add ax,[var2] // add var2 to it, or whatever...
jz jp1
...
}
jp1:
... and so on
}
Christopher Hill
Aiea, Hawai`i (O`ahu)
--
- Jeff Lait (SOL)
Normally, I would just use local stack variables. But in this case,
I WANT the variables to be in the code segment (like the docs say will
happen). In this particular case, I want to save SS and SP in the
code segment, invoke INT 2E (backdoor to COMMAND.COM), then restore
SS and SP upon return (INT 2E saves only CS:IP). So, that's why I
"need" to do this. Reentrancy is not a problem or issue. And the
code is not self-modifying.
Chris
--