From: Mark Slagell Newsgroups: comp.os.msdos.djgpp Subject: Re: AT&T Assembly, Random Functions Date: Sat, 12 Jul 1997 13:56:00 -0500 Organization: the well-basically society Lines: 44 Message-ID: <33C7D340.28BE@geocities.nospam.com> References: <5q891u$na8$1 AT excalibur DOT flash DOT net> NNTP-Posting-Host: dial28.ppp.iastate.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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.