From: "B. Peterson" Newsgroups: comp.os.msdos.djgpp Subject: Re: Help with graphics and inline asm please. Date: 22 Oct 1996 12:28:43 GMT Organization: US Postal News Server Lines: 50 Message-ID: <01bbc02d$a7f47de0$88015838@peterstb.usps.gov> References: <01bbc016$d29f7660$88015838 AT peterstb DOT usps DOT gov> NNTP-Posting-Host: petersbd.usps.gov To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Nevermind.. I figured it out. our_global_selecter, x, y, and color have to be global variables. New question... Is this the only way of doing it? Is there some way of passing the parameters x, y, and color to the function? B. Peterson wrote in article <01bbc016$d29f7660$88015838 AT peterstb DOT usps DOT gov>... > 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 >