Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Moving To Windows Vista X64, Moving to Windows Vista x64
dedyradix
post Mar 21 2007, 01:37 PM
Post #1


Newbie [Level 1]
*

Group: Members
Posts: 19
Joined: 7-May 06
Member No.: 23,209



QUOTE
Introduction
This is an introduction to Windows Vista and the x64 architecture. Writing an article like this is always uneasy, because there's plenty to talk about, but on the other hand it's an article, not a book. I tried to focus on some important aspects, but it goes without saying it that I had to cut out a lot (e.g. the User-Mode Driver Framework, and I'm very sorry for that). This is just a general overview on certain topics, if you want to learn more, then you should really consider turning to specific guides. Also, I won't talk about some obvious matters of the x64 architecture, like the fact that applications can now access a larger memory range etc. This article should be considered a quick upgrade for x86/XP developers.

At the time I write this article I've been using Windows Vista for a month and its official release is scheduled for January 30th (so, in another month). I moved to x64 with XP some months ago and at the time I did I was surprised that I found all the drivers for my devices. But, as we know, Windows Vista requires drivers to be certified, and in order to get the certification companies have to supply a x64 version of the driver. No certification will be released for x86-only drivers. However, at the moment I write, a lot of applications like virtual drive encrypters don't provide drivers for Vista (since x64 versions haven't got a certificate). If you didn't know about the certification, don't worry, I'll talk about it later and you'll see that it's still possible to run drivers without it. I just wanted to say that hardware compatibility is no longer an issue like it was one year ago, and by switching to Windows Vista x64 you're not taking too much chances.

I tried to organize this article in two sections, one about the changes brought us by x64 and then by Vista. I tried as hard as possible to separate these two things, because the x64 technology already existed under Windows XP, so it was important to me that the reader was given a clear distinction between those things that affect only Vista and those ones which affect both topics.

x64 Section
x64 Assembly
In this paragraph I'll try to explain the basics of x64 assembly. I assume the reader is already familiar with x86 assembly, otherwise he won't be able to make heads or tails of this paragraph. Moreover, since this is just a very (but very) brief guide, you'll have to look into the AMD64 documentation for more advanced stuff. Some stuff I won't even mention, you'll see by yourself that some instructions are no longer in use: for instance, that the lea instruction has completely taken place of the mov offset.

What you're going to notice at once is that there are some more registers in the x64 syntax:

8 new general-purpose registers (GPRs).
8 new 128-bit XMM registers.
Of course, all general-purpose registers are 64 bits wide. The old ones we already knew are easy to recognize in their 64-bit form: rax, rbx, rcx, rdx, rsi, rdi, rbp, rsp (and rip if we want to count the instruction pointer). These old registers can still be accessed in their smaller bit ranges, for instance: rax, eax, ax, ah, al. The new registers go from r8 to r15, and can be accessed in their various bit ranges like this: r8 (qword), r8d (dword), r8w (word), r8b (low byte).

And now, the most important things. Calling convention and stack. x64 assembly uses FASTCALLs as calling convention, meaning it uses registers to pass the first 4 parameters (and then the stack). Thus, the stack frame is made of: the stack parameters, the registers parameters, the return address (which I remind you is a qword) and the local variables. The first parameter is the rcx register, the second one rdx, the third r8 and the fourth r9. Saying that the parameters registers are part of the stack frame, makes it also clear that any function that calls another child function has to initialize the stack providing space for these four registers, even if the parameters passed to the child function are less than four. The initialization of the stack pointer is done only in the prologue of a function, it has to be large enough to hold all the arguments passed to child functions and it's always a duty of the caller to clean the stack. Now, the most important thing to understand how the space is provided in the stack frame is that the stack has to be 16-byte aligned. In fact, the return address has to be aligned to 16 bytes. So, the stack space will always be something like 16n + 8, where n depends on the number of parameters. Here's a small figure of a stack frame:

info>>>http://www.codeproject.com/vista/vista_x64.asp#C/C++_Programming

Notice from jlhaslip:
BBcode tags required. Cut and Pasted. Warned
Go to the top of the page
 
+Quote Post
ghostrider
post Mar 22 2007, 08:36 PM
Post #2


Super Member
*********

Group: Members
Posts: 397
Joined: 9-June 06
From: Wisconsin
Member No.: 24,924



Interesting. I can't wait until I get a 64-bit processor and I can start utilizing 64-bit technology with my programs I write and the other ones I use. Thanks for sharing.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Make Windows Xp Look Like The Mac Interface(38)
  2. Virtual Memory Error... Windows Xp(5)
  3. Error Installing Windows Xp -error 7 Ntkrnlmp.exe(11)
  4. Is There An Adium-like Im Client For Windows?(18)
  5. Run Internet Explorer From Command Prompt(22)
  6. Windows Vista Tranformation Pack(75)
  7. How To Change Windows Xp Language ?(23)
  8. Dual Booting Vista And Xp With This?(9)
  9. Garage Band! Windows Version?(10)
  10. Vista Rocks(41)
  11. How To Hack Windows Pinball!(24)
  12. Internet Connection Sharing With Xbox 360 And A Laptop(7)
  13. Win Xp Or Vista(40)
  14. Never Use Windows Vista(16)
  15. Windows Vista Randomly Freezing(15)
  1. What's The Real Minimum Requirement Of Vista(7)
  2. Windows Explorer Randomly Crashing(6)
  3. Windows Xp: Explorer.exe Crashes On Certain Accounts(3)
  4. World Of Warcraft And Vista With Choppy Frame Rates(2)
  5. Ajax Windows(7)
  6. How To Disable Flashing In Windows Freecell(0)
  7. Its's Official Microsoft Is Done With The Windows Operating System(12)
  8. Windows Xp & Ubuntu’s Cold War(5)
  9. Moving A Forum(2)
  10. How Many Times Do You Reinstall Windows In A Year(15)
  11. Vista Unable To Surf Internet(3)
  12. Panasonic Lumix - Problems With Movie Files(0)
  13. Windows Vista Installation Fails(1)


 



- Lo-Fi Version Time is now: 6th September 2008 - 06:24 AM