Article View: comp.lang.misc
Article #4278Re: Accessing registers in Microsoft Visual C++???
From: Joel Rubin
Date: Sat, 23 Sep 1995 21:45
Date: Sat, 23 Sep 1995 21:45
44 lines
1658 bytes
1658 bytes
In article <441ccm$mqu@ixnews7.ix.netcom.com>, chappie@ix.netcom.com
says...
>
>Hi there!
>I was wondering if Microsoft C compilers have an equivalent to
>Borland's register pseudovariables. I'm trying to compile IPX/SPX
>functions written for the Borland compiler in Microsoft's compiler, but
>I'm receiving compiler errors.
>
>For example, the following code:
>
> _BX = 0x0010;
> _AL = 0x00;
>
> if (_AL == 0)
> return 0;
>
>compiles in Borland, but I get an error "undeclared variable" message
>w/ Microsoft.
>I checked Microsoft's Knowledge base but found nothing.
>Any help would be appreciated.
>Thanks.
>
>chappie@ix.netcom.com
>Rich
In Microsoft C(++) you have to use in-line assembler instead.
_asm {
mov bx,10
mov al,0
cmp al,0
jne not_zero
}
return 0;
not_zero: ...
(Yes, I know you can do this more efficiently--I'm trying to copy the
logic of the "C".)
As with Borland, you can avoid the {} and put _asm in front of every
line. Unlike Borland, there is no option for using a full assembler with
the inline stuff.
Technical Details
Message-ID:
<441v51$bpr@ixnews3.ix.netcom.com>Path:
arc1-ca.pugleaf.net!ix.netcom.com!netnewsReferences:
<441ccm$mqu@ixnews7.ix.netcom.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ix.netcom.com!netnews From: jmrubin@ix.netcom.com (Joel Rubin) Newsgroups: comp.lang.misc,comp.lang.asm.x86,comp.os.msdos.programmer,comp.lang.c,comp.lang.c++ Subject: Re: Accessing registers in Microsoft Visual C++??? Date: 23 Sep 1995 21:45:05 GMT Organization: Netcom Message-ID: <441v51$bpr@ixnews3.ix.netcom.com> References: <441ccm$mqu@ixnews7.ix.netcom.com> NNTP-Posting-Host: ix-sf10-20.ix.netcom.com Mime-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII X-NETCOM-Date: Sat Sep 23 2:45:05 PM PDT 1995 X-Newsreader: WinVN 0.99.6 NT