www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/19/10:12:20

From: A DOT D DOT Brown AT bradford DOT ac DOT uk
Subject: DJGPP assembler documentation
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Thu, 19 Jan 1995 14:50:02 +0000 (GMT)

Hi,

I've recently been experimenting with assembler in my djgpp C++ programs -
and I've a few problems because I can't find the relevent documentation.
(I've had to experiment by using gcc -S and learning from the output)

1) In assembly routines, which registers can you safely clobber.  I know
that eax is used for the return value, but changing edi without saving it
caused some really psychadelic bugs.  (Asthetic maybe, but not desirable)

2) Is doing an external assembly module, I do the following: (is it the
correct way to do things?)

.text

.globl _Routine
_Routine:
	pushl %ebp
	movl %esp, %ebp

	... routine (variables passed referenced at 8(%ebp), 12(%ebp), 16(%ebp) etc.)

	leave
ret


3) Turbo assembler makes the reference of passed variables very easy by
allowing you to specify them.  While it looks like this is possible using
inline assembler, is it possible in as?

4) I've looked at inline assembly that other people have done and can't find
any documentation on it with djgpp.  For example, when you specify which
registers are clobbered, I guess that "d" means edx, "D" means edi, etc.
Is this right?  Does "I" mean integer?  Where can I find documentation?

Any help would be greatly appreciated.

Alistair
-- 
EMAIL: A DOT D DOT Brown AT bradford DOT ac DOT uk

- Raw text -


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