Article View: comp.os.msdos.programmer
Article #5998Re: Turbo C++ - inline assembler
From: Dion Hollenbeck
Date: Mon, 29 Apr 1991 15:46
Date: Mon, 29 Apr 1991 15:46
38 lines
1637 bytes
1637 bytes
In article <_rwg.m=@rpi.edu> court@rpi.edu (Court Demas) writes:
>
> I've been rewriting a few of my C routines in assembler (with the
> asm{} constuct), but I can't seem to create any labels in the code.
> This is very annoying to say the least. I'm using Turbo C++ 1.01.
>
> e.g.:
>
> asm{
> ...
> cmp ax,0
> jz LAB1:
>
> LAB1:
> inc ax
> ...
> }
>
> It gives me error saying something about 'invalid assembler opcode' on the
> 'LAB1:' line. Any suggestions? thanks..
This would be illegal with any assembler. While you MUST put a
colon after the definition of a label you CAN'T put a colon
on the reference to it. Should be:
jz LAB1
The reason you are probably getting the error on the label line
is that many compilers/assemblers think an error at end of line
screws up the next line, but the previous line is OK.
--
-----
Dion Hollenbeck (619) 455-5590 x2814
Megatek Corporation, 9645 Scranton Road, San Diego, CA 92121
uunet!megatek!hollen or hollen@megatek.uucp
Technical Details
Message-ID:
<HOLLEN.91Apr29084618@orion.megatek.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!bridge2!jarthur!ucivax!megatek!orion!hollenReferences:
<_rwg.m=@rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!bridge2!jarthur!ucivax!megatek!orion!hollen From: hollen@megatek.UUCP (Dion Hollenbeck) Newsgroups: comp.os.msdos.programmer Subject: Re: Turbo C++ - inline assembler Message-ID: <HOLLEN.91Apr29084618@orion.megatek.UUCP> Date: 29 Apr 91 15:46:18 GMT References: <_rwg.m=@rpi.edu> Sender: hollen@megatek.UUCP Distribution: comp.os.msdos.programmer Organization: Megatek Corporation, San Diego, California Lines: 38 In-reply-to: court@rpi.edu's message of 27 Apr 91 00:48:02 GMT