Date: Mon, 3 May 1999 09:54:20 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Radu Georgescu aka skoola cc: djgpp AT delorie DOT com Subject: Re: asm In-Reply-To: <372CBF1D.891D92CD@go.ro> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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