Variables in inline assembly?

Programming, for all ages and all languages.
Post Reply
Dewah77
Posts: 5
Joined: Wed Aug 10, 2016 6:27 am

Variables in inline assembly?

Post 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
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Variables in inline assembly?

Post 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
Post Reply