delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/04/17:31:32

Date: Sun, 4 Jan 1998 14:29:37 -0800 (PST)
Message-Id: <199801042229.OAA27028@adit.ap.net>
Mime-Version: 1.0
To: "elizabeth anne dominy" <msunguli AT global DOT co DOT za>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: REQ: Wait for Retrace function

At 05:36  1/3/1998 GMT, elizabeth anne dominy wrote:
>Hi,
>
>First off, thanx to all those who replied to my last message. They helped,
>and to Eli, I found the time to read the FAQ, but it wasn't what I was
>looking for. Thanx anyway.
>
>As it is I'm busy trying to convert my old Pascal libraries to DJGPP C++. I
>know enough C to convert the Pascal source without too many problems, but
>the assembler sections I put together are still problematic. I need help
>with a few things, and they are
>
>1 : I need to know what the calling conventions are in DJGPP C++, and how
>to 'return' from a function that consists entirely of inline asm. Something
>similar to returning any word values in the AX register as is Pascal's
>calling convention. Unfortunately my knowledge of the DJGPP compiler is not
>that great.
The calling conventions are:
Arguments are pushed right-to-left.
Called function should NOT remove its arguments from the stack.
The DS, ES, EBP, EDI, ESI and EBX registers must be preserved.
Returned pointer and integer values are returned in the EAX register.
Returned floating-point values are returned in the top of the 387 stack.
Returned structures are very complicated, so try to avoid them.
Return with a near 32-bit return (`ret').
>
>2 : My wait retrace function is screwing up, and it won't assemble
>properly. Where can I get the full AT&T/Unix ASM specs in one document that
>is NOT an FAQ. (I don't find the FAQ format helpful, because my questions
>generally aren't answered well, or are phrased so differently they take an
>age to find!)
DJGPP FAQ section 18.13 contains pointers to many other sources.
There is no document which specifies the AT&T asm syntax, per se. However,
the `as' manual explains most of the differences between it and Intel
syntax. Try this:
info as "Machine" "i386"
There is a tutorial on the net somewhere, I think the FAQ mentions it.
>
>3 : For quick help, I'd appreciate it if someone could tell me the syntax
>for JMP and labels in AT&T ASM.
infinite_loop:
        jmp infinite_loop

There are also local labels. See:
info as "Symbols" "Symbol Names"
and scroll down one page.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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