Mail Archives: djgpp-workers/2000/12/29/13:54:06
At 01:25 PM 12/29/00 -0500, Peter J. Farley III wrote:
>At 02:12 PM 12/29/00 +0000, Morten Welinder wrote:
> >
> >Would it be possible to simply define an LCALL macro to hide the
> >assembler differences? It seems to me that spreading a complicated
> >version test out to a zillion places is going to bring grief in
> >the future.
>
>An *excellent* idea, if only I knew how to code gas macros. I only
>know IBM 3[679]0 Assembler well enough to know how to code macros,
and
>that doesn't help much here.
>
>If you (or someone) can code the macros, I would be happy to change
the
>
>code to use them. We would need LJMP as well as LCALL. I would also
>need some advice on how gas searches for macros (do I #include them
or
>does gas look in someplace like /include or what?). And how do we
use
>a macro in something like dbgcom.c, which has lots and lots in inline
>asm? FWIW, dbgcom.c has the most occurrences of lcall and ljmp
>instructions, so that's where the macro is needed most at the moment.
Just answered my own questions. We can, of course, use suitably coded
#define-style C macros, even in .S sources. I see, for example, in
exceptn.S, macors defined like this:
#define EXCEPTION_ENTRY(number) \
pushl number ; \
jmp exception_handler
And obviously this can also be used for LJMP and LCALL.
I'll work on another version of those changes that uses macros instead
of direct coding.
---------------------------------------------------------
Peter J. Farley III (pjfarley AT dorsai DOT org OR
pjfarley AT banet DOT net)
- Raw text -