Sign in to follow this  

using 64-bit numbers on 32-bit OS

This topic is 4198 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have an AMD Opteron 244 processor, says on the box it allows for "simultaneous 32-bit and 64-bit computing", so I guess it supports 64-bit numbers. If this is the case, is it possible to use 64-bit numbers in my programs even though I have a 32-bit version of windows? What I want to do is multiply two 64-bit integers and get the 128-bit answer I can multiply two 32-bit integers and get the 64-bit answer in the following way:
mov	eax, dword ptr [num1]
mov	edx, dword ptr [num2]
mul	edx

mov	dword ptr [ans_low], eax
mov	dword ptr [ans_high], edx

Is it possible to multiply two 64-bit integers and get the 128-bit answer in a similar way? I tried using qword ptr instead of dword, but the compiler complained, I guess it assumes the registers to be 32-bit. I know pretty much nothing about 64-bit computing, are these same registers 64-bit? Or do I need to use some other registers? If it's the same, and can be used on Win32, can I set the Visual C++ Express 2005 to allow for 64-bit on them? If not, is there any other compiler I can use? Thx, /Erik

Share this post


Link to post
Share on other sites
thanks for you answer, but i want to use the processors actual 64-bit instructions, writing it in normal code makes it call some function that emulates it..

anyway it doesn't matter, i found in the documentation now that the express edition of visual-c++ doesn't allow for 64 bit :( so i have to get some other compiler


i'm still wondering however, can I use the 64 bit registers from within an application that runs on normal 32-bit windows?
additional searching has led me to believe this isn't possible since the processor seems to require to be set into "long mode".. i didn't find any good site about it though so i'm not sure..

i'll stick to 32-bit for now at least =)

Share this post


Link to post
Share on other sites
Just doing some quick reading over google and some teechnical documentation. In assembly you have to intrupt the cpu to move from protected mode to long mode. Although, this may sound good but in actualy fact it isnt. When switching over to long mode, the cpu will assume all instructions you are sending it are 64 bits long. the stack will be modified to 64 bits with call, pop and the rest doing the same thing.

So in actualy fact you will suddenly crach two things. Mabe your operating system, or your application. I dont know if you can move between the two modes like windows 98 se did with 16 bit and 32 bit because of a bug within the cpu that enabled the cpu to be reset and the memory in the cpu not to be wiped.

Although with the amd 64 bits in your machines if your running a win32 bit os, you could hack and do assembly language. But it could seriously screw things over going from 32 bit mode to 64 bit mode within your application.

Your going to need to buy a new compiler that enables you to compile 64 bit executables that will run on xp 64.

Share this post


Link to post
Share on other sites

This topic is 4198 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this