Mail Archives: djgpp/1997/07/12/21:18:06
Josh, only global variables can be accessed the way you're doing it. So
instead of:
> void setpal (int index, byte red, byte gre, byte blu)
> {
> asm ("movw $0x1010, %ax
> movw $_index, %bx
> movb $_red, %ch
> movb $_gre, %cl
> movb $_blu, %dh
> int $0x10");
> }
>
you might try:
int global_i;
char global_r, global_g, global_b;
. . .
void setpal (int index, byte red, byte gre, byte blu)
{
global_i = index;
global_r = red;
global_g = gre;
global_b = blu;
asm ("movw $0x1010, %ax
movw $_global_i, %bx
movb $_global_r, %ch
movb $_global_g, %cl
movb $_global_b, %dh
int $0x10");
}
Alternatively, it is more elegant (though not very intuitive) to use
extended inline and assign variables that way, and then they don't have
to be globals. Maybe somebody has the url for Brennan's inline doc
onhand for you; it's good reading.
--
"There is no theory. You have merely to listen. Fantasy is the law."
-- Claude Debussey
Remove the ".nospam" to reply by email.
- Raw text -