I have some code which I've written in Intel syntax assembly, which I now need to convert to AT&T syntax so that I can run it in an asm block in some C++ code.
I'm working with C++ with in Code::Blocks, using gcc 4.8.1 under Windows 8.
Here is my original code:
__asm
{
mov eax, stack_top;
mov ebx, state;
mov ecx, ti;
mov esp, eax;
push ecx;
push ebx;
call my_setjmp;
pop ecx;
or eax, eax;
je ret_label;
push ecx;
call call_task;
ret_label:
}
I made an attempt to convert it to AT&T syntax, but it isn't working:
asm(
"mov stack_top , %eax;"
"mov state , %ebx;"
"mov ti , %ecx;"
"movw %eax , %esp;"
"push %ecx;"
"push %ebx;"
"call my_setjmp;"
"pop %ecx;"
"or %eax, %eax;"
"je ret_label;"
"push %ecx;"
"call call_task;"
"ret_label:"
);