-
December 6th, 2010, 03:59 PM
#1
Inline Assembly C++ Help
Could someone please tell my how i can use the cin function in inline assembly
-
December 6th, 2010, 04:42 PM
#2
Re: Inline Assembly C++ Help
Why would you do that? Why don't you explain what you try to achieve. You should avoid as much as possible inline assembly. For instance, for the x64 platform, inline assembly in VC++ is no longer supported.
-
December 6th, 2010, 04:46 PM
#3
Re: Inline Assembly C++ Help
How can assembly become unsupported when it makes higher level languages
-
December 6th, 2010, 04:54 PM
#4
Re: Inline Assembly C++ Help
Originally Posted by gaar321
How can assembly become unsupported when it makes higher level languages
Everything that was previously supported may "become unsupported" if the developer chose to break the support...
And what could it have to do with the "higher" or "lower" level languages?
Victor Nijegorodov
-
December 6th, 2010, 04:58 PM
#5
Re: Inline Assembly C++ Help
One of the major points to C++ is portability, and the second you include an _asm block, it becomes locked down to the x86 architecture, and as cilu said, the 64-bit version of MSVC does not support inline asm. You should instead stick to intrinsics.
-
December 6th, 2010, 05:11 PM
#6
Re: Inline Assembly C++ Help
The point of using inline assembly is to super-optimize a particular chunk of code---usually an inner loop. The idea is that 80% of the time is spent in 20% of the code, so you can focus your extreme optimizations on just a few places and see a significant benefit. Optimizing in the wrong place gives you almost no benefit for (potentially) a lot of work.
cin is a means of reading input from the console. Reading input is always slow, and cin often blocks waiting for user input. This is beyond slow---the program may actually stop for a while. There is thus absolutely no point in trying to write inline assembly that includes console input.
-
December 7th, 2010, 05:32 AM
#7
Re: Inline Assembly C++ Help
Originally Posted by gaar321
How can assembly become unsupported when it makes higher level languages
Well, things like this happen. As I said, please explain what you try to accomplish, maybe we can help with suggestions.
-
December 7th, 2010, 06:02 AM
#8
Re: Inline Assembly C++ Help
Agree that there is no sence to use cin in Assembly. Anyway, if you want to know how to use cin (or anything else) in Assembly, make C++ program and read its Assembly output.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|