OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 2:15 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Variables in inline assembly?
PostPosted: Fri Aug 12, 2016 8:34 am 
Offline

Joined: Wed Aug 10, 2016 6:27 am
Posts: 5
I'm trying to get this code to work
Code:
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:
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


Top
 Profile  
 
 Post subject: Re: Variables in inline assembly?
PostPosted: Fri Aug 12, 2016 8:48 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: DotBot [Bot] and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group