Mail Archives: djgpp/1996/10/22/17:50:26
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 <bpeterson AT ntip DOT usps DOT gov> 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
>
- Raw text -