Mail Archives: djgpp/1999/05/03/02:57:47
On Mon, 3 May 1999, Radu Georgescu aka skoola wrote:
> when optimizing my program, the compiler modifies my asm statements and
> the program crashes.
> 1) what should i do to make gcc not to optimize my source
You need to tell the compiler which registers your inline assembly
clobbers, as part of the inline assembly code. See the section
"Extended Asm" in the GCC docs, by typing this from the DOS prompt:
info gcc "c extensions" "extended asm"
(Note the quotes: they are important.)
> 2) how can i compile my sources as libraries?
See section 8.22 of the FAQ. However, I believe you won't need this
once you tell the compiler which registers are clobbered.
> 3) how can i use constant values in my asm statement (like those
> declared with define; note that the asm statement is a sting, therefore
> define wont work)
The ## operator can be used to concatenate #define'd macros, and the #
operator can be used to stringify a macro argument. See the
pre-processor docs for more details, by typing these lines from the
DOS prompt:
info cpp macros stringification
info cpp macros concatenation
- Raw text -