473,769 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Another inline assembly question

Hi group,

inspired by the other inline assembly thread a question popped up in my
mind... Victor Bazarov mentioned in his response that the asm() clause
was covered by the C++ standard, subclause 7.3.. Well, I couldn't find
the C++ standard definition on the net, so I'm asking here:

Why is a thing like assembly covered by the standard at all? According
to Victor's response, it seems to be totally compiler dependent what's
done with the char* I pass on to asm(). If that were true, usage of
asm() would always yield undefined results (according to the standard).
Doesn't that totally defy the purpose of a standard in the first place?

And isn't usage of a highly object-oriented language mixed with
_assembly_, a language not only dependant on the running OS (like
implementation of system/library calls), but also to the very most
extent dependant on the hardware a little bit odd?

Well, just wondered... hope somebody can clear that up.
Greetings,
Johannes

--
PLEASE verify my signature. Some forging troll is claiming to be me.
My GPG key id is 0xCC727E2E (dated 2004-11-03). You can get it from
wwwkeys.pgp.net or random.sks.keys erver.penguin.d e.
Also: Messages from "Comcast Online" are ALWAYS forged.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCUz2GCse FG8xyfi4RAuiQAJ sG0juW41Uru5F/KNgPax88SEb65wC fYFqK
Ty9+dh5y17fNfCV pi/32bbc=
=NQhT
-----END PGP SIGNATURE-----

Jul 23 '05
11 1621
E. Robert Tisdale wrote:
The JVM *is* available to other languages like C++.

May be I have missed that. May you provide more information on this? Is there a JVM C++
compiler?

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #11

"Ioannis Vranos" <iv*@remove.thi s.grad.com> wrote in message
news:1112809414 .369683@athnrd0 2...
Walter wrote:
And can't C++ just say that shorts are 16 bits? Does anyone care about
programming the PDP-10 in C++? (I personally have a big soft spot for
the -10, but let's face it, it's been obsolete for 20 years.) Anyone have 18 bit shorts on the CPU drawing table? I'd be shocked if there was. When people mention "Java" they are actually talking about two things. The

Java language (syntax) and the Java framework (JVM).
I'm talking about Java the language, of course, including its semantics as
well as syntax.
So in few words, C++ takes advantage of all facilities a system provides. If you target a virtual machine you get the type sizes and other facilities of the virtual machine, if you target a native machine you get the sizes of the native machine.


Are there any current or projected CPUs that have don't have 16 bit shorts?
Are there any current C++ compilers where shorts aren't 16 bits? Where chars
aren't 8 bits? Anyone have plans for one?

(BTW, Java targetting a VM rather than a native CPU is not what makes it
portable. What makes it portable is having more thoroughly defined semantics
of the language than C++ has. Java the language can, and has been,
implemented without a VM.)
Jul 23 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2164
by: __PPS__ | last post by:
Hello I have a simple question about inline asm. suppose I have asm { push eax, 123 } does it mean that it will have exactly this effect as in usual asm or it's just a suggestion to the compiler (meaning that the compiled program might probably use some other register in place of eax) Thanks. Ps. I do not have any intention to use inline asm.
3
3674
by: Ganesh Tawde | last post by:
Hi. I am trying to use the below pure assembly code as inline assembly in C. The pure assembly code gives proper data but the inline assembly code gives me distorted data. I am not able to figure out the problem. can any body help me on this? here is the working pure assembly function *************************************************************************
18
5069
by: Method Man | last post by:
If I don't care about the size of my executable or compile time, is there any reason why I wouldn't want to inline every function in my code to make the program run more efficient?
30
19757
by: Will Pittenger | last post by:
Does C# inline functions? I do not see a inline keyword. Is there an implicit inline? Can the compiler select functions for auto-inlining? I am more used to C++ where all these things are possible. ---------- Will Pittenger E-Mail: mailto:will.pittenger@verizon.net All mail filtered by Qurb (www.qurb.com)
8
1753
by: neilmcguigan | last post by:
I just wanted to list some reasons why I prefer inline code to code-behind. 1. you can fix some bugs more quickly. remote desktop into server, change the aspx file, and she's good to go. I'd say this is one of the major reasons classic ASP became so popular. 2. don't have to upload the large codebehind site DLL to fix one bug. 3. updating the codebehind site DLL restarts the application. fixing
9
2899
by: chinu | last post by:
hi all, i did a small experiment to grasp the advantages of declaring a function as inline. inline int fun1(); int main(){ unsigned int start=0,end=0; asm("rdtsc\n\t"
7
3171
by: ypjofficial | last post by:
Hello All, Inline before a function definition is just a request to the compiler to make the function inline. The compiler may or maynot make it inline.. My question is ..is there any way by which I can find at runtime whether the particular function which is marked as inline,is made inline or is treated like other function by the compiler ?
2
1830
by: =?Utf-8?B?TWljayBPJ05laWxs?= | last post by:
I am currently trying to wrap an old library (ImageMagick) in .NET, and am having problems with inline expansions. I have recompiled the library in vc++ 2005 OK. However, when I try to access any inline methods of the library classes from my managed classes, the inlining does not seem to occur, and I end up with a linker error 2001 - unresolved external. Is there a trick for getting this to work. I have tried using Default inline (/Ob0) in...
15
2821
by: Chris Peters | last post by:
Hello Group Can anyone confirm or suggest workrounds for the following bug in lccwin32. If an inline assembly statement immediately follows a for loop and you try to set a breakpoint on it, then the breakpoint is hit at each iteration of the loop, not after the loop finishes. Thanks Chris
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.