delorie.com/archives/browse.cgi | search |
From: | Endlisnis <s257m AT unb DOT ca> |
Newsgroups: | comp.os.msdos.djgpp,comp.lang.asm.x86 |
Subject: | Re: Accessing C #define in inline assembly |
Date: | 16 Aug 1998 13:18:36 GMT |
Organization: | NBTel Internet |
Lines: | 22 |
Approved: | <johnfine AT erols DOT com> |
Message-ID: | <6r6m7c$qbs$1@winter.news.erols.com> |
References: | <6r53ca$afu$1 AT winter DOT news DOT erols DOT com> |
NNTP-Posting-Host: | 207-172-240-168.s41.as3.bsd.erols.com |
Mime-Version: | 1.0 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Rylan wrote: > In DJGPP inline assembly, how can I access symbols "#defined" in the C file > in which the relevant inline assembly occurs? > #define TIMEOUT 9000 #define ASMTIMEOUT $9000#define STRING(DEF) #DEF //How come the stringify symbol '#' can't be used like #($ ## DEF) ???? > __asm__ __volatile__ > ("mov " STRING(ASMTIMEOUT) ",%cx"); That should do it. It may not be that pretty, but it think it works. -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT GeoCities DOT com Endlis AT nbnet DOT nb DOT ca
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |