delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/22/14:48:24

From: "B. Peterson" <bpeterson AT ntip DOT usps DOT gov>
Newsgroups: comp.os.msdos.djgpp
Subject: Help with graphics and inline asm please.
Date: 22 Oct 1996 09:45:27 GMT
Organization: US Postal News Server
Lines: 37
Message-ID: <01bbc016$d29f7660$88015838@peterstb.usps.gov>
NNTP-Posting-Host: petersbd.usps.gov
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm new to djgpp and asm.  I've read the FAQ and was looking at the example
given at http://remus.rutgers.edu/~avly/djgfx.html   I am trying to get an
example to work but I'm having problems.
It compiles ok but doesn't link correctly.  The errors are:

Linking:
 test1.c(.text+0x13): undefined reference to `our_global_selector'
 test1.c(.text+0x1e): undefined reference to `y'
 test1.c(.text+0x2a): undefined reference to `x'
 test1.c(.text+0x33): undefined reference to `color'


The routine looks like this:


putpixel(int x, int y, int color)
{
   short our_global_selector;
   our_global_selector = _dos_ds;

   __asm__ __volatile__("
       movw _our_global_selector, %es\n
       movl $0xA0000, %edi\n
       movw _y, %ax\n
       imulw $320, %ax\n
       addw _x, %ax\n
       addw %ax, %di\n
       movb _color, %al\n
       stosb"
       );
}


Can someone tell me what I'm doing wrong?

Thanks
Bruce

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019