Click to See Complete Forum and Search --> : Arrays, Floats and doubles on inline ASM?
NighaŽe
Oct 2nd, 2004, 10:09 AM
hi,
I'm trying to figure out how to use array and floats with asm
for example
int nOp1 = 10;
int nOp2 = 2;
int nOp1 = 10;
int nOp2 = 5;
__asm mov eax, nOp1;
__asm add eax, nOp2;
in this case the result of eax = 15
float fOp1 = 10.5f;
float fOp2 = 3.07f;
__asm mov eax, fOp1;
__asm add eax, fOp2;
in this case the result of eax = -4.3434515e-038
next problem i have i using array structures (stored in vector)
pCodes.push_back( OpCode( OC_MOV, a ) );
pCodes.push_back( OpCode( OC_ADD, b ) );
pCodes.push_back( OpCode( OC_MOVR, r ) );
to store the execution of the opcode (r = a + b)
pOC = pCodes[nCode];
__asm mov eax, pOC.Data
this part of code is working
__asm mov eax, pCodes[nCode];.Data
this ain't :
warning C4537: 'nCode' : '.' applied to non-UDT type
error C2410: 'Data' : ambiguous member name in 'second operand'
visualAd
Oct 3rd, 2004, 03:05 AM
Originally posted by dglienna
if it's a dial-up account, then these posts won't help. I assume that AOL is dialup, but I could be wrong. Internet Connection Sharing should be able to do what you want, though.
Can you find each PC from the other by its IP address? The first time you click on it, you may have to log on with a username/password. If you do, you could just map the drive on the machine, and have it retain the connection for all log ons in the future. I do that from my XP laptop to a W2K Workstation, and everything works fine.
The W2K machine has an account for LAPTOP, otherwise, I can't see the shared folders (and printer). Others have suggested otherwise, but it works for me just fine.
If he doesn't need to share the internet connection then all he needs for both the computers to communicate is forthem to have IP addresses in the same subnet.
NighaŽe
Oct 3rd, 2004, 07:53 AM
lol visualAd, what has this to do with my question :)
visualAd
Oct 3rd, 2004, 12:04 PM
Sorry - this happened a couple of days back too. I reply to one thread and it a ppears in another totally random thread. :rolleyes:
Maven
Oct 3rd, 2004, 08:09 PM
Originally posted by NighaŽe
hi,
I'm trying to figure out how to use array and floats with asm
for example
int nOp1 = 10;
int nOp2 = 2;
int nOp1 = 10;
int nOp2 = 5;
__asm mov eax, nOp1;
__asm add eax, nOp2;
in this case the result of eax = 15
float fOp1 = 10.5f;
float fOp2 = 3.07f;
__asm mov eax, fOp1;
__asm add eax, fOp2;
in this case the result of eax = -4.3434515e-038
next problem i have i using array structures (stored in vector)
pCodes.push_back( OpCode( OC_MOV, a ) );
pCodes.push_back( OpCode( OC_ADD, b ) );
pCodes.push_back( OpCode( OC_MOVR, r ) );
to store the execution of the opcode (r = a + b)
pOC = pCodes[nCode];
__asm mov eax, pOC.Data
this part of code is working
__asm mov eax, pCodes[nCode];.Data
this ain't :
warning C4537: 'nCode' : '.' applied to non-UDT type
error C2410: 'Data' : ambiguous member name in 'second operand'
The problem your having with doing floating point numbers is because your talking to the wrong processor / unit. When doing calculations for floating point numbers, you have to use the FPU (Floating Point Unit).
You can't work with arrays the C++ way in ASM. You have to do it the ASM way, IE: you use offsets to move through the array.
Darkwraith
Oct 7th, 2004, 12:21 PM
The thing is that you deal with arrays in C++, in the assembler way (base + offset). The problem is that you do not deal with vectors in C++ the assembler way.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.