Mail Archives: djgpp/1996/07/04/20:01:26
Xref: | news2.mv.net comp.os.msdos.djgpp:5674
|
From: | vecna AT Walden DOT mo DOT net ([vecna])
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Setpixel in AT&T inline asm....
|
Date: | 4 Jul 1996 17:54:13 GMT
|
Organization: | -=MO.NET=- MVP-Net, Inc's Missouri Operations
|
Lines: | 44
|
Message-ID: | <4rh0g5$m9r@twain.mo.net>
|
NNTP-Posting-Host: | walden.mo.net
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Alright, I need help with inline ASM in DJGPP. (well, I need help with
any sort of ASM in DJGPP) I was a big time intel asm programmer - in fact
I programmed in 100% assembly at the time so I'm can't live with out ASM.
And I'm really just learning C as I go along here, but right now my problem
isn't with C, it's with AT&T ASM. I'm trying to write a simple putpixel to
a 320x200 virtual screen, which is already allocated and defined as:
char *virscr;
This is my (yes, unoptimized) setpixel routine:
setpixel(int x, int y, char c)
{
asm("pushl %eax \n\t"
"pushl %ebx \n\t"
"pushl %edi \n\t"
"movzx $_y, %eax \n\t"
"imul $320, %eax \n\t"
"movzx $_x, %ebx \n\t"
"add %ebx, %eax \n\t"
"mov $_virscr, %ebx \n\t"
"add %ebx, %eax \n\t"
"mov %eax, %edi \n\t"
"movb $_c, %al \n\t"
"stosb \n\t"
"popl %edi \n\t"
"popl %ebx \n\t"
"popl %eax \n\t");
}
The immediate problem being, it can't recognize movzx. I can't think of any
other alias this was be listed as... not to mention I'm really guessing here.
There's probably tons of other flaws in this routine. (I really don't want to
get into extended ASM just yet). Also, could someone confirm or correct me
that a char is a byte, an int is 16 bits? (or is it 32?) geez, what I wouldn't
give for db, dw, and dd right now.... oh well, thanks in advance.. :)
=============================================================================
[vecna] crs: code/music/design/www boingo/crs/eos/#lunar
vecna AT mo DOT net www page: http://mo.net/~vecna nineinchnails/quake
moo AT tss DOT survivor DOT org home of the nin music archive Eomar on #lunarRPG
=============================================================================
- Raw text -