just few lines of MASM to get infos about the current OS:
Code:
TITLE GetOSVersion 
.586 
.model flat,stdcall 
option casemap:none 
assume fs:nothing 
include windows.inc 
include user32.inc 
include kernel32.inc 
includelib user32.lib 
includelib kernel32.lib 
WIN_2K equ 0h 
WIN_XP equ 1h 
WIN_2K3 equ 2h 
WIN_NT equ 4h 
WIN_VISTA equ 6h 
.data 
mbtitle BYTE "GetOSVersion",0h 
winNT BYTE "found winNT!",0h 
win2K BYTE "found win2K!",0h 
win2K3 BYTE "found win2K3!",0h 
winXP BYTE "found winXP!",0h 
winVista BYTE "found winVista!",0h 
.code 
main proc 
   push MB_OK 
   push offset mbtitle 
   mov esi, fs:[30h] ; PEB 
   mov eax, [esi + 0a4h] ; majorV 
   cmp eax, WIN_NT 
   jbe @winNT 
   cmp eax, WIN_VISTA 
   jz @winVista 
   mov ebx, [esi + 0a8h] ; minorV 
   cmp ebx, WIN_2K 
   jz @win2K 
   cmp ebx, WIN_XP 
   jz @winXP 
   cmp ebx, WIN_2K3 
   jz @win2K3 
@winNT: 
   push offset winNT 
   jmp @cont 
    
@win2K: 
   push offset win2K 
   jmp @cont 
    
@win2K3: 
   push offset win2K3 
   jmp @cont 
    
@winXP: 
   push offset winXP 
   jmp @cont 
    
@winVista: 
   push offset winVista 
   jmp @cont 
    
@cont: 
   push 0 
   call MessageBox 
   push 0 
   call ExitProcess 
main endp 
end main
It's also possible to add win9x... this is your homework :)