To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


EIT Planet's Security News
 Security Vulnerabilities Prove Increasingly Costly
 IPS Market Approaches $1 Billion
 U.S. Named Top Spammer

Security Products
 Family Keylogger (Family Keylogger)
 modusGate (Vircom Inc.)
 Kernel Hotmail MSN Password Recovery (Nucleus Data Recovery)
 Outlook 2003 PST Password Recovery (PST Password Recovery)
 PST Password Remove (PST Password Remove)
 Zemana Anti Keylogger (Vickit, Inc.)


Go Back   Antionline Forums - Maximum Security for a Connected World > Security Discussions > Programming Security

Programming Security Talk about secure programming practices & making security apps.

Reply
 
Thread Tools Display Modes
Old July 23rd, 2002, 04:31 AM   #1
toxic-ram
Junior Member
 
Join Date: Jul 2002
Posts: 19
toxic-ram is on a distinguished road
Question Including Assembly Code in C++ Programs

I'm using the free Borland compiler (version 5.5) and I want to use assembly language in my programs... But I can't find out how in the help files. And the tutorial I'm learning C++ with says that each compiler's command is different and goes on to a different topic. Can someone help me? Thanks.
__________________
~TOXIC-RAM
toxic-ram is offline   Reply With Quote
Old July 23rd, 2002, 07:02 AM   #2
avdven
The Iceman Cometh
 
Join Date: Aug 2001
Posts: 1,210
avdven avdven avdven avdven avdven avdven avdven avdven avdven avdven avdven
As far as I know, Borland C++ (at least Turbo C++ and the original Borland C++ (not too sure about C++ Builder), doesn't allow you to integrate assembly language into your programs. Many C/C++ compilers out there are just that, and do not include separate assemblers to handle asm. There are separate programs from Borland (including tasm) which will do assembly language, but I'm not sure if you can somehow incorporate tasm into a C++ program. If I'm wrong, someone please correct me.

AJ
avdven is offline   Reply With Quote
Old July 23rd, 2002, 07:28 AM   #3
8*B@LL
Senior Member
 
Join Date: Aug 2001
Posts: 356
8*B@LL has a spectacular aura about8*B@LL has a spectacular aura about8*B@LL has a spectacular aura about
try doing something like this:
Code:
_asm	
	{		wait
			fnstcw	old_cw
			wait
			mov	ax, word ptr old_cw
			or	ah, 0xc
			mov	word ptr new_cw,ax
			fldcw	new_cw
	}
that exact code is used in some source i have and i know it will compile in msvc++("_asm" is a reserved word). obviously you would want to replace the code inside with whatever asm you wanted. give it a shot, you might get lucky
__________________
-8-

There are 10 types of people in this world: those who understand binary, and those who dont.
8*B@LL is offline   Reply With Quote
Old July 23rd, 2002, 07:34 AM   #4
avdven
The Iceman Cometh
 
Join Date: Aug 2001
Posts: 1,210
avdven avdven avdven avdven avdven avdven avdven avdven avdven avdven avdven
8*B@LL, Microsoft Visual C++ 6.0 (post SP4 or SP5, I think) and VC++.NET includes the C++ preprocessor pack which includes the ability to compile assembly language from within C++ programs. Before the preprocessor pack was released (it was released as a separate download for users of versions prior to SP4/5) you were required to install a separate assembler (I prefer masm) and configure the compiler to allow you to use that as a separate directive when compiling your programs. In my experiences with Borland prodcuts (which I used to use when I first started programming C/C++ as well as Pascal and Assembly Language) there is no way to incorporate this type of asm segement into C++ and have it compile correctly.

AJ
avdven is offline   Reply With Quote
Old July 23rd, 2002, 11:02 AM   #5
8*B@LL
Senior Member
 
Join Date: Aug 2001
Posts: 356
8*B@LL has a spectacular aura about8*B@LL has a spectacular aura about8*B@LL has a spectacular aura about
ah, well like i said, it was just a "shot in the dark" so-to-speak.
__________________
-8-

There are 10 types of people in this world: those who understand binary, and those who dont.
8*B@LL is offline   Reply With Quote
Old July 23rd, 2002, 06:55 PM   #6
toxic-ram
Junior Member
 
Join Date: Jul 2002
Posts: 19
toxic-ram is on a distinguished road
Hey 8*B@LL, I tried what you said (_asm thing) and the compiler recognized it! But it then tried to run "tasm32.exe" and couldn't find it... I'm going to try to find out if TASM is free or not. Do you know anything about it? Thanks everyone for the info.

EDIT: Never mind I found the full package of TASM32... In case anyone who reads this wants to get TASM also... Here is the link to the page: http://www.axe.empexed.net/html/tools.html. There are also other tools like UltraEdit and a disassembler.
__________________
~TOXIC-RAM
toxic-ram is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:04 PM.












Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.