Error: operand type mismatch for `mov'
Posted: Thu Aug 04, 2016 4:17 am
I've encountered a problem with inline assembly. Maybe this is very nooby question, but why I'm getting this error:
in this code:
? Tell me if you want some other info.
Code: Select all
/tmp/ccgqP61A.s: Assembler messages:
/tmp/ccgqP61A.s:255: Error: operand type mismatch for `mov'
/tmp/ccgqP61A.s:255: Error: operand type mismatch for `mov'
Code: Select all
void switch_task(struct task *task)
{
asm("mov eax, %0;"
"mov ebx, %1;"
"mov ecx, %2;"
"mov edx, %3;"
"mov esi, %4;"
"mov edi, %5;"
"push %6;"
"popf;"
"mov esp, %7;"
"mov cr0, %8;"
"mov cr3, %9;"
"jmp %10;" :
"=g" (task->eax),
"=g" (task->ebx),
"=g" (task->ecx),
"=g" (task->edx),
"=g" (task->esi),
"=g" (task->edi),
"=g" (task->eflags),
"=g" (task->stack),
"=g" (task->cr0),
"=g" (task->cr3),
"=g" (task->eip));
}