From: patrickd AT cmdnet DOT lu (DOSTERT Patrick) Newsgroups: comp.os.msdos.djgpp Subject: Re: more NASM/DJGPP HELP please... Date: Fri, 13 Mar 1998 06:30:35 GMT Organization: All USENET -- http://www.Supernews.com Lines: 33 Message-ID: <3508d128.432409694@news.supernews.com> References: Reply-To: patrickd AT cmdnet DOT lu 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 On Thu, 12 Mar 1998 20:58:59 -0800, sochaxx AT flash DOT net (art socha) wrote: >global _plot ;called from c plot(int x; inty; char col); >_plot: > push ebp > mov ebp,esp ;point to stack > xor eax,eax ;eax=0 > xor ebx,ebx ;ebx=0 > mov word eax,[ebp+10] ;eax = y > mov word ebx,[ebp+8] ;ebx = x > xchg ah,al ;y * 256 > add bx,ax ;bx = (y*256)+x > shr ax,2 ;ax = (y*64) > add bx,ax ;bx = (y*320)+x > add dword ebx,[_vid] ;add our offset to the video pointer > mov byte al,[ebp+12] ;al = color > mov byte [ebx],al ;draw it! > pop ebp > ret > ints and chars take 4 bytes so: x is at [ebp + 8] y is at [ebp + 12] color is at [ebp + 16], replace mov byte al,[ebp + 12] by mov eax,[ebp + 16] in mov byte [ebx],al, byte is not needed since al is byte-sized cu P