www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/24/12:45:26

Xref: news2.mv.net comp.os.msdos.djgpp:6364
From: Luke Steele <luke AT jaglogic DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Inline assembly and DMA transfers.
Date: Wed, 24 Jul 1996 14:34:43 GMT
Organization: INTERact BBS UK (01753) 775533
Lines: 47
Message-ID: <Dv208s.Iz1@ftp.jags.co.uk>
References: <199607230018 DOT KAA25409 AT gbrmpa DOT gov DOT au>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Leath Muller <leathm AT gbrmpa DOT gov DOT au> wrote:

>void fill_block()
>{
>	asm volatile ("
>		pushl	%eax;
>		pushl	%ebx;
>		pushl	%ecx;

>		movl	$50, %ecx;
>		movl	_value, %ebx;
>		movl	_mem_block, %eax;

>	loop:
>		movl	%ebx, (%eax);
>		addl	$4, %eax;
>		decl	%ecx;
>		cmpl	$0, %ecx;
>		jnz	loop;

>		popl	%ecx;
>		popl	%ebx;
>		popl	%eax;
>	");
>}

>int main(void)
>{
>	mem_block = (char *)malloc(200);
>	value = 0;	// not really needed
>	fill_block();
>	free(mem_block);
>}

>Leathal.

Ok, but I'm not sure what the pushing and popping is about.  Does the
compiler rely on certain registers being left alone, and is this why
you're your storing these registers?  If so, which registers does the
compiler rely on the value of?


--
Luke Steele
(luke AT jags DOT co DOT uk)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019