ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/23/10:51:45

Date: Thu, 23 Feb 1995 10:33:34 -0500
From: morphine AT whatever DOT cs DOT jhu DOT edu (Michael Phelps)
Sender: morphine AT whatever DOT cs DOT jhu DOT edu
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Inline asm and structs

	Is there any way to access an element (type long) from an array of
structs from within an inline asm?  I know I can do something like:

	long	x;

	asm(
	"movl	$0, _x\n"
	::);

(provided x is global/static), but how can I do the equivalent of C

typedef struct
{
	long	first;
	long	second;
} vector;

vector	data[10];

for (x=0; x < 10; x++)
{
	data[x].first = 0;
}

This is not exactly what I want to do with asm, but it is an example of how I
want to address my struct  (like "data[x].first").  Any ideas besides
transferring all the .first elements into an array of their own, or is this the
only way to proceed?
						---Michael Phelps, MD
.\

- Raw text -


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