There are times it would be good to be able to write assembly code to
integrate with other VS languages, such as VS C++ .NET. For example, I might
want to write a REALLY fast algorithm that does CALCULATIONS only and
bypasses any overhead imposed by the compiler.
Is inline assembly still possible? Wouldn't a Visual Assembler language make
some sense (although the 'visual' is only to imply compatibility and
seemless integration into other Visual languages)? 12 1549
"Peter Anthony" <po*******@roundtripllc.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
There are times it would be good to be able to write assembly code to
integrate with other VS languages, such as VS C++ .NET. For example, I
might want to write a REALLY fast algorithm that does CALCULATIONS only
and bypasses any overhead imposed by the compiler.
Is inline assembly still possible? Wouldn't a Visual Assembler language
make some sense (although the 'visual' is only to imply compatibility and
seemless integration into other Visual languages)?
I'm pretty sure x86 inline assembler is still alive and kicking in the
latest VC++, although I seem to remember that x86_64 might not be. I'd also
think that inline assembly now recognizes more instructions than ever
before.
However, you're better off writing very simple C code (register transfer
style) and let the optimizer run, it will probably generate better machine
code than you. Humans can keep track of register spills pretty effectively
but when you add pipelining, branch prediction, cache associativity, and a
whole bunch of other factors, instruction costs are not constant and there's
no way a programmer can optimize them all in a reasonable amount of time.
On Wed, 19 Dec 2007 16:25:07 -0600, "Ben Voigt [C++ MVP]"
<rb*@nospam.nospamwrote:
> "Peter Anthony" <po*******@roundtripllc.comwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
>There are times it would be good to be able to write assembly code to integrate with other VS languages, such as VS C++ .NET. For example, I might want to write a REALLY fast algorithm that does CALCULATIONS only and bypasses any overhead imposed by the compiler.
Is inline assembly still possible? Wouldn't a Visual Assembler language make some sense (although the 'visual' is only to imply compatibility and seemless integration into other Visual languages)?
I'm pretty sure x86 inline assembler is still alive and kicking in the latest VC++, although I seem to remember that x86_64 might not be. I'd also think that inline assembly now recognizes more instructions than ever before.
However, you're better off writing very simple C code (register transfer style) and let the optimizer run, it will probably generate better machine code than you. Humans can keep track of register spills pretty effectively but when you add pipelining, branch prediction, cache associativity, and a whole bunch of other factors, instruction costs are not constant and there's no way a programmer can optimize them all in a reasonable amount of time.
It is also often true that spending the same time working on the
design of the program data flow and algorithms yields far better
improvements that trying to hand craft assembler code.
Besides, "real men" don't need Visual tools. Edlin is good enough for
us!
Edlin is good enough for us!
Only if you're a glutton for punishment.
"Larry Smith" <no_spam@_nospam.comwrote in message
news:Og**************@TK2MSFTNGP05.phx.gbl...
>Edlin is good enough for us!
Only if you're a glutton for punishment.
True, but vim is good enough, and it's not really any less arcane.
I LOVE vim, the best editor in the world!
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Larry Smith" <no_spam@_nospam.comwrote in message
news:Og**************@TK2MSFTNGP05.phx.gbl...
>>Edlin is good enough for us!
Only if you're a glutton for punishment.
True, but vim is good enough, and it's not really any less arcane.
I was a fan of "Brief" myself many moons ago but I understand there's a Vim
plugin that can emulate it.
Peter Anthony wrote:
:: There are times it would be good to be able to write assembly code
:: to integrate with other VS languages, such as VS C++ .NET. For
:: example, I might want to write a REALLY fast algorithm that does
:: CALCULATIONS only and bypasses any overhead imposed by the
:: compiler.
::
:: Is inline assembly still possible? Wouldn't a Visual Assembler
:: language make some sense (although the 'visual' is only to imply
:: compatibility and seemless integration into other Visual
:: languages)?
If you have the full package - Professional Edition - VS does include
an assembler. Just add a .asm file to your project and compile!
It is just that hardly anybody uses it, because it is *extremely* hard
to outsmart the compiler. If you can shave more than one or two asm
instructions from a compiled function, you are at the Guru level !
Bo Persson
"Bo Persson" <bo*@gmb.dkwrote in message
news:5s*************@mid.individual.net...
Peter Anthony wrote:
:: There are times it would be good to be able to write assembly code
:: to integrate with other VS languages, such as VS C++ .NET. For
:: example, I might want to write a REALLY fast algorithm that does
:: CALCULATIONS only and bypasses any overhead imposed by the
:: compiler.
::
:: Is inline assembly still possible? Wouldn't a Visual Assembler
:: language make some sense (although the 'visual' is only to imply
:: compatibility and seemless integration into other Visual
:: languages)?
If you have the full package - Professional Edition - VS does include an
assembler. Just add a .asm file to your project and compile!
It is just that hardly anybody uses it, because it is *extremely* hard to
outsmart the compiler. If you can shave more than one or two asm
instructions from a compiled function, you are at the Guru level !
It's easy to shave *instructions*. But fewer instructions doesn't mean
smaller or faster code. And while the size of each instruction can be
known, the speed is dependent on far too many factors to consider by hand.
>
Bo Persson
r norman wrote:
Edlin is good enough for us!
Theoretically we only need a keyboard with two buttons: 0 and 1, and we
could enter machine code directly that way.
Tom
Peter Anthony wrote:
There are times it would be good to be able to write assembly code to
integrate with other VS languages, such as VS C++ .NET. For example, I might
want to write a REALLY fast algorithm that does CALCULATIONS only and
bypasses any overhead imposed by the compiler.
Is inline assembly still possible? Wouldn't a Visual Assembler language make
some sense (although the 'visual' is only to imply compatibility and
seemless integration into other Visual languages)?
Roughly speaking, you want something like:
int main() {
//c++ code
__asm {
//inline assembly code
}
}
Check out the msdn pages on it, for something authoritative: http://msdn2.microsoft.com/en-us/library/45yd4tzz.aspx
--
SM
rot13 for email
"Tamas Demjen" <td*****@yahoo.comwrote in message
news:u8***************@TK2MSFTNGP03.phx.gbl...
>r norman wrote:
>Edlin is good enough for us!
Theoretically we only need a keyboard with two buttons: 0 and 1, and we
could enter machine code directly that way.
Any telegraph operator will tell you that a single button is sufficient
(thanks to Samuel Morse).
>
Tom
You could make a program like,
int main()
{
asm mov eax,2
asm mov ebx,4
asm add eax,ebx
asm cmp eax,5
asm je ok
no:
ok:
return 0;
}
"Shadowman" <fu**********@pbzpnfg.argescribió en el mensaje
news:fk**********@aioe.org...
Peter Anthony wrote:
>There are times it would be good to be able to write assembly code to integrate with other VS languages, such as VS C++ .NET. For example, I might want to write a REALLY fast algorithm that does CALCULATIONS only and bypasses any overhead imposed by the compiler.
Is inline assembly still possible? Wouldn't a Visual Assembler language make some sense (although the 'visual' is only to imply compatibility and seemless integration into other Visual languages)?
Roughly speaking, you want something like:
int main() {
//c++ code
__asm {
//inline assembly code
}
}
Check out the msdn pages on it, for something authoritative: http://msdn2.microsoft.com/en-us/library/45yd4tzz.aspx
--
SM
rot13 for email
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Seth Guard |
last post by:
(Sorry for the cross-post, but no one responded to my other thread.)
When developing a web page in VS.Net, I see everything in WYSIWYG
format. And when I am creating a User Control, I see that...
|
by: Marcus |
last post by:
We all know that the "gets" function from the Standard C Library (which
is part of the Standard C++ Library) is dangerous. It provides no
bounds check, so it's easy to overwrite memory when using...
|
by: maniac |
last post by:
Hey guys, I'm new here, just a simple question.
I'm learning to Program in C, and I was recommended a book called,
"Mastering C Pointers", just asking if any of you have read it,
and if it's...
|
by: Dave win |
last post by:
howdy....
plz take a look at the following codes, and tell me the reason.
1 #define swap(a,b) a=a^b;b=b^a;a=a^b
2
3 int main(void){
4 register int a=4;
5 register int b=5;...
|
by: Tolga |
last post by:
After a very rapid entrance into the Python, I have immediately looked
for a good IDE. Komodo and Wing IDE look very good and I think they are
enough. But now, I am searching for a Pyhton...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |