Page 1 of 1

Variables in inline assembly?

Posted: Fri Aug 12, 2016 8:34 am
by Dewah77
I'm trying to get this code to work

Code: Select all

void terminal_setcursor(int row, int col)
{
	ia(
	"mov %AH, 0x02\n\t"
	"mov %BH, 0\n\t"
	"mov %DH, row\n\t"
	"mov %DL, col"
	);
}
Unfortunately it doesnt recognize the 'row' and 'col'

Code: Select all

kernel.o: In function `terminal_setcursor':
kernel.c:(.text+0x19e): undefined reference to `row'
kernel.c:(.text+0x1a4): undefined reference to `col'
What should I do in this case?
Thanks for your help

Re: Variables in inline assembly?

Posted: Fri Aug 12, 2016 8:48 am
by iansjack
Dewah77 wrote:What should I do in this case?
You should read the section on how to use in-line assembly: http://wiki.osdev.org/Inline_Assembly