Board index » cppbuilder » More on Inline Assembly Problems.

More on Inline Assembly Problems.

I have Borland C++ Standard edition and when I attempt
to use any sort of assembly in a unit the program
stops working all together.  

This problem occurs with even the most simple of programs
(containing only the assembly code and no other code).

An example is:
asm {PUSH DX}

but it happens with ANY assembly code I use.

Is this a C++ builder problem in general or am I doing
something wrong?

 

Re:More on Inline Assembly Problems.


I BCB4 std does not come with TASM so you can not do assembler with that
version.  You need Pro or higher.

Quote
Mehmet Gunes wrote:

> I have Borland C++ Standard edition and when I attempt
> to use any sort of assembly in a unit the program
> stops working all together.

> This problem occurs with even the most simple of programs
> (containing only the assembly code and no other code).

> An example is:
> asm {PUSH DX}

> but it happens with ANY assembly code I use.

> Is this a C++ builder problem in general or am I doing
> something wrong?

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The mist crawls from the c{*word*7}like some primordial phantom of romance
To curl, under the cascade of neon pollen.  While I sit tied to the phone
like some expectant father, your carnation will rot in a vase.
             (Fish)
--

Re:More on Inline Assembly Problems.


It should allow inline ASM though should it not?

--
.............
......... Jason C. Leach
...... University College of the Cariboo
... j...@mail.ocis.net
.. http://www.ocis.net/~jcl
.

The Search for Extraterrestrial Intelligence from Home:
http://setiathome.ssl.berkeley.edu

Re:More on Inline Assembly Problems.


I have an older version of TASM, can get C++Builder Standard to use that?

OR is there any other way to get the assembly to work with C++Builder?

It is STUPID they do not have inline assembly!  C/C++ has had
that almost since it's invention!  
I am not going to buy the same compiler again just to get a feature that
the first one should have in the first place!  If borland keeps this
up they are going to start losing customers!

Quote
"Jeff Overcash (TeamB)" wrote:

> I BCB4 std does not come with TASM so you can not do assembler with that
> version.  You need Pro or higher.

Re:More on Inline Assembly Problems.


No you can't use the external TASM.  That TASM can't be used internally by the
compiler.  BCB4 std is meant to be a basic learning edition only.  Pro is needed
if you want to do any serious work.  I do not think that TASM was included in
BCB3 or even BCB1 std either, but I might be mistaken on that.  The SKU on the
websight though clearly indicates that the built in TASM is not included in BCB4
std.

Quote
Mehmet Gunes wrote:

> I have an older version of TASM, can get C++Builder Standard to use that?

> OR is there any other way to get the assembly to work with C++Builder?

> It is STUPID they do not have inline assembly!  C/C++ has had
> that almost since it's invention!
> I am not going to buy the same compiler again just to get a feature that
> the first one should have in the first place!  If borland keeps this
> up they are going to start losing customers!

> "Jeff Overcash (TeamB)" wrote:

> > I BCB4 std does not come with TASM so you can not do assembler with that
> > version.  You need Pro or higher.

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The mist crawls from the c{*word*7}like some primordial phantom of romance
To curl, under the cascade of neon pollen.  While I sit tied to the phone
like some expectant father, your carnation will rot in a vase.
             (Fish)
--

Re:More on Inline Assembly Problems.


What I did was write the ASM method and compile it to an OBJ file with
TASM, then I just did an: #include "C" "myFile.OBJ" can you can make
function calls.  It may even be a better way to do it that inline asm as
it makes for a faster compile time.  Only draw back is you need to learn
a little more ASM that you like, but as an aspiering programmer this
will do nothing but good for you.

Also try the ASM forum on news.inprise.com

--
.............
......... Jason C. Leach
...... University College of the Cariboo
... j...@mail.ocis.net
.. http://www.ocis.net/~jcl
.

The Search for Extraterrestrial Intelligence from Home:
http://setiathome.ssl.berkeley.edu

Re:More on Inline Assembly Problems.


Quote
: Jason <j...@mail.ocis.net> wrote:
>It should allow inline ASM though should it not?

No, because TASM is used for all aspects related to assembler in
C++Builder. And that includes inline assembler, I am afraid.

--
Stefan Hoffmeister (TeamB)     http://www.econos.de/
Please do apply judgement when sending email.

Re:More on Inline Assembly Problems.


There is a free ASMer called NASM you might want to give a try.

J

--
.............
......... Jason C. Leach
...... University College of the Cariboo
... j...@mail.ocis.net
.. http://www.ocis.net/~jcl
.

The Search for Extraterrestrial Intelligence from Home:
http://setiathome.ssl.berkeley.edu

Re:More on Inline Assembly Problems.


I can't really believe they would not include TASM with BCB4.  That I am
sure makes soo many programs unusable, not to mention it disallows so
much in the way of optimization.

j

--
.............
......... Jason C. Leach
...... University College of the Cariboo
... j...@mail.ocis.net
.. http://www.ocis.net/~jcl
.

The Search for Extraterrestrial Intelligence from Home:
http://setiathome.ssl.berkeley.edu

Re:More on Inline Assembly Problems.


They provide TASM with BCB4, but only in Professional version and up.

Chris (TeamB)

Quote
Jason wrote in message <37C1520F.BF23B...@mail.ocis.net>...
>I can't really believe they would not include TASM with BCB4.  That I am
>sure makes soo many programs unusable, not to mention it disallows so
>much in the way of optimization.

>j

>--
>.............
>......... Jason C. Leach
>...... University College of the Cariboo
>... j...@mail.ocis.net
>.. http://www.ocis.net/~jcl
>.

>The Search for Extraterrestrial Intelligence from Home:
>http://setiathome.ssl.berkeley.edu

Re:More on Inline Assembly Problems.


Quote
: Jason <j...@mail.ocis.net> wrote:
>There is a free ASMer called NASM you might want to give a try.

This assembler uses a different syntax than TASM and hence cannot compile
the code emitted by the Borland C++ compiler for inline assembly.

In case someone is still interested in NASM .98:

  http://www.cryogen.com/nasm/

Supports OBJ (OMF-style), OBJ (COFF-style), ELF, BIN, RDOFF and one more
obscure thing I have forgotten about right now (and I am too lazy to
check). Supports all (un)documented instructions of all 80x86 processors
including the 8088, including AMD and Cyrix instruction extensions. The
only thing that misses as of NASM version .98 are the five new AMD Athlon
3D Now! instructions.

--
Stefan Hoffmeister (TeamB)     http://www.econos.de/
Please do apply judgement when sending email.

Re:More on Inline Assembly Problems.


hi,

Hope this is not too late in the thread.  But is 'ASM' a C++ keywork?  I just
picked up my lates Comp. Sci text book and it seems to think it is.  This
would lead me to believe that ASM is a part of standard C++? Oui/Non?

JJason

Quote
"Chris Uzdavinis (TeamB)" wrote:
> They provide TASM with BCB4, but only in Professional version and up.
> Chris (TeamB)--

.............
......... Jason C. Leach
...... University College of the Cariboo
... j...@mail.ocis.net
.. http://www.ocis.net/~jcl
.

The Search for Extraterrestrial Intelligence from Home:
http://setiathome.ssl.berkeley.edu

Re:More on Inline Assembly Problems.


Quote
On Mon, 30 Aug 1999 21:00:53 -0700, Jason <j...@mail.ocis.net> wrote:
>is 'ASM' a C++ keywork?  I just
>picked up my lates Comp. Sci text book and it seems to think it is.  

Lower case "asm" is a recognized declaration in ANSI/ISO C++.
See 7.4 of the Standard. "The meaning of an asm declaration
is implementation-defined."

Quote
>This would lead me to believe that ASM is a part of standard C++?

Only the declaration. Assembler itself isn't.

--
Wayne A. King
(ba...@torfree.net, wayne.k...@ablelink.org,
 wak...@idirect.com, Wayne_A_K...@compuserve.com)

Re:More on Inline Assembly Problems.


Quote
: Jason <j...@mail.ocis.net> wrote:
>But is 'ASM' a C++ keywork?  

Yes.

Quote
>This would lead me to believe that ASM is a part of standard C++? Oui/Non?

Yes, it is a *recognised* keyword. But there is nothing in the ANSI C++
Standard that mandates that the compiler compile assembler statements (for
whatever processor - that is implementation dependent). There are just
provisions that inline assembler *can* be compiled by an ANSI C++
compiler.

--
Stefan Hoffmeister (TeamB)     http://www.econos.de/
Please do apply judgement when sending email.

Other Threads