delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/17/14:15:05

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: extended inline asm with djgpp
Date: 17 Feb 2002 18:57:11 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 33
Message-ID: <a4oue7$b98$1@antares.lu.erisoft.se>
References: <6124b64f DOT 0202110619 DOT 5aeda0ef AT posting DOT google DOT com>
NNTP-Posting-Host: lws256.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Luis (luisllo AT alumni DOT uv DOT es) wrote:
: Hi ciberfolks!!

: I have a problem using inline asm in my C code with DJGPP. I have read
: a lot of tutorials in the web, and all seems to be ok, but I always
: get the same error message when I try to compile the next code:

: ----------------------------------------------------------------------
: #include <stdio.h>

: asm(" pushl %%edx; movl %0,%%eax; mov %1,%%dx; movw %%dx,%%ss:(%%eax);
: popl %%edx" : : "m" (pcar), "m" (car));

: int main(void)
: {
:     /* stuff */
: }
: ----------------------------------------------------------------------

: The error message is the next one:
: test.c:3: parse error before ':'

: I'm using a pentium machine with windows Me, and I don't have any idea
: of why it's not working, am I missing any header file?, please help!

You're trying to add program executable statements outside any
function. That won't work. Try moving your assembler statements into
main() or some other function.


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019