From: Dave Bird Newsgroups: comp.os.msdos.djgpp Subject: anyone see what's wrong with this ? Date: Sat, 6 Mar 1999 22:16:04 +0000 Organization: very little Message-ID: NNTP-Posting-Host: xemu.demon.co.uk X-NNTP-Posting-Host: xemu.demon.co.uk:158.152.196.209 X-Trace: news.demon.co.uk 920758660 nnrp-02:28311 NO-IDENT xemu.demon.co.uk:158.152.196.209 X-Complaints-To: abuse AT demon DOT net MIME-Version: 1.0 X-Newsreader: Turnpike (32) Version 4.01 Lines: 36 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Parse error before string" at the INPUT line. #include /* */ /* STRING-LENGTH of zero-terminated string... */ /* just a demo of using in-line assembler. */ /* */ int str_len(char *str){ int num=0; asm( "decl %ecx /n/t" /* --num */ "FIND: incl %ecx /n/t" /* ++num */ "movb [%ebx], %al /n/t" /* al = [ebx++] */ "incl %ebx /n/t" "orb %al, %al /n/t" /* if al !=0 */ "jnz FIND /n/t" /* go round again */ | :"c"(num) /*[OUTPUT from ECX]*/ | :"c"(num) "b"(str) /*[INPUT to EBX,CX]*/ <=+ :"%eax" /*[JUNKED eax] */ ); return num; } int main(){ int j; char *rope="Rhinocerus"; printf("\n\n\n\n\n\nHello-2\n"); printf("length of str was = %i\n",str_len(rope)); printf("enter a number?"); scanf("%i",&j); return 0; }; -- ^-^-^-@@-^-;-^ http://www.xemu.demon.co.uk/ (..)__u news:alt.smoking.mooses .