Computer Chess Club Archives


Search

Terms

Messages

Subject: local/temporary labels in gcc inline assembly

Author: Robert Hyatt

Date: 20:55:36 12/08/02


Here is a question I can not find an answer to:

How can I define a local lable in a gcc inline assembly block of code?

IE I want to do this:

        test   %eax,%eax
        jz     skip
        do something
skip:

But if I make that piece of code happen in something I would like to
see inlined, "skip" obviously causes problems.  I found some examples
such as:

        test %eax,%eax
        jz   skip%=
        do something
skip%=:

where %= is supposed to be replaced by a unique integer value that changes
each time the inline function is exploded in place.  However, I simply get
skip%= as the label and it breaks on that...

Has anyone done this and gotten it to work?

I hate to resort to 'jump to here + x" as x has a bad habit of changing
as the cpu internals change...




This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.