c++.dos.32-bits - assembler troubles
- Gisle Vanem (18/18) Jul 01 2002 What's wrong with these defines:
- Gisle Vanem (10/19) Jul 01 2002 I figured it out. This works:
What's wrong with these defines: #define stackset(stk) asm { mov ax, ss \ mov ebx, esp \ mov cx, ds \ mov ss, cx \ lea esp, stk \ push eax \ push ebx } #define stackrestore() asm lss esp, [esp] When I say: static UINT stack [256]; stackset (stack[255]); The compiler issues this error: stackset (stack[255]); ^ pcpkt.c(892) : Error: end of line expected What's wrong? Gisle V.
Jul 01 2002
"Gisle Vanem" <giva bgnett.no> wrote in message news:afpm7v$2db1$1 digitaldaemon.com...What's wrong with these defines: #define stackset(stk) asm { mov ax, ss \ mov ebx, esp \ mov cx, ds \ mov ss, cx \ lea esp, stk \ push eax \ push ebx }I figured it out. This works: #define stackset(stk) asm { mov ax, ss; \ mov ebx, esp; \ mov cx, ds; \ mov ss, cx; \ lea esp, stk; \ push eax; \ push ebx } Gisle V.
Jul 01 2002