|
-
Oct 2nd, 2004, 10:09 AM
#1
Thread Starter
Addicted Member
Arrays, Floats and doubles on inline ASM?
hi,
I'm trying to figure out how to use array and floats with asm
for example
int nOp1 = 10;
int nOp2 = 2;
Code:
int nOp1 = 10;
int nOp2 = 5;
__asm mov eax, nOp1;
__asm add eax, nOp2;
in this case the result of eax = 15
Code:
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)
Code:
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)
Code:
pOC = pCodes[nCode];
__asm mov eax, pOC.Data
this part of code is working
Code:
__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'
-
Oct 3rd, 2004, 03:05 AM
#2
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.
-
Oct 3rd, 2004, 07:53 AM
#3
Thread Starter
Addicted Member
lol visualAd, what has this to do with my question
-
Oct 3rd, 2004, 12:04 PM
#4
Sorry - this happened a couple of days back too. I reply to one thread and it a ppears in another totally random thread.
-
Oct 3rd, 2004, 08:09 PM
#5
Hyperactive Member
Re: Arrays, Floats and doubles on inline ASM?
Originally posted by Nigh™a®e
hi,
I'm trying to figure out how to use array and floats with asm
for example
int nOp1 = 10;
int nOp2 = 2;
Code:
int nOp1 = 10;
int nOp2 = 5;
__asm mov eax, nOp1;
__asm add eax, nOp2;
in this case the result of eax = 15
Code:
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)
Code:
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)
Code:
pOC = pCodes[nCode];
__asm mov eax, pOC.Data
this part of code is working
Code:
__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.
Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde
-
Oct 7th, 2004, 12:21 PM
#6
Fanatic Member
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.
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
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
|