2
2

আমাদের কম্পিউটারের জন্য যখন কোন সফটওয়্যার ডাউনলোড করার প্রয়োজন হয় তখন আমাদের দেখতে হয় আমাদের মেশিন ৬৪ বিট নাকি ৩২ বিট । ৩২ বিটের জন্য আমরা ৩২ বিট সফটওয়্যার ডাউনলোড করি এবং ৬৪ বিটের জন্য ৬৪ বিট সফটওয়্যার ডাউনলোড করতে হয় ।

আমার প্রশ্ন হল একটা সফটওয়্যার ৩২ ও ৬৪ বিটের জন্য কিভাবে আলাদা করে লেখে । ধরেন আমি আমার কম্পিউটারের জন্য একটা গেম বানাতে চাই । সেই গেমই টি ৩২ / ৬৪ বিট কম্পিউটার উভয়ই চালাতে পারব । এখন গেমের জন্য আমি যে কোড লিখবো সেটা কি ৩২ বিটের জন্য আলাদা এবং ৬৪ বিটের জন্য আলাদা করে লিখতে হবে ।

ধন্যবাদ ।

asked 13 Jan '17, 08:29

menon's gravatar image

menon
4.5k330

edited 25 Jan '17, 15:25


When you say 32 bit or 64 bit, it does not refer to the software. It refers to the architecture of the processor of the computer on which the software can be installed. . A 32 bit processor can accept a maximum of 32 bits (4 bytes) of information in one stream or cycle, while a 64 bit system can accept 64 bits (8 bytes) of information per cycle. Hence programs are made as per these limitations. In general 64 bit processors are better for multitasking as they can accept and process larger amounts of data. .
32 bit software/OS for 32 bit or 64 bit systems. (since 32<64, 32 bit is supported on 64 bit systems) .
64 bit software/OS for 64 bit systems only. .
So whats the difference between them?Nothing much, really. The 64 bit version is optimized to use those extra 32 bits to run the program faster and run multiple functions but both programs will be same in terms of features.

permanent link

answered 20 Jan '17, 20:53

Nazmul%20H%20Pranto's gravatar image

Nazmul H Pranto
2818

1

If you translate this in bangla then it's better to understand for me. Thanks @nazmul92

(23 Jan '17, 16:55) menon
(25 Jan '17, 15:45) Nazmul H Pranto

উত্তর দেয়ার জন্য ধন্যবাদ । আমি মনে হয় আমার প্রশ্ন বোঝাতে পারি নি :( @nazmul92 ভাই

(26 Jan '17, 07:03) menon

একটা সফটওয়্যার ৩২ ও ৬৪ বিটের জন্য কিভাবে আলাদা করে লেখার দরকার নাই । একই কোড যদি ৩২ বিট কম্পিউটারে কম্পাইল করা হয় তবে সেটা ৩২ বিটের জন্য হয়ে যাবে । এবং কোড যদি ৬৪ বিট কম্পিউটারে কাম্পাইল করা হয় তবে সেটা ৬৪ বিটের জন্য হয় যাবে ।

permanent link

answered 21 Nov, 14:46

menon's gravatar image

menon
4.5k330

To summarize, no, it's not necessary; they could have used a single folder, and no, Windows does not present itself differently to a program being run from one location or another.


Well, everybody seems to be throwing in their opinions on this, so I'll toss in my 2¢. Others have already conjectured on the reasons as to why Microsoft chose to create separate top-level folders for 32-bit and 64-bit versions of programs, so I'll leave that part (the best reason was David's explanation that it is as a convenience to programmers). Of course even then, it doesn't quite address the direct question why is this even necessary?, to which the answer is presumably: it's not.

Instead, I'll address the main body of the question

Does Windows somehow present itself differently to a program running out of "Program Files (x86)"?

Not really, but the location of the program can affect the behavior, but not in the way you would think.

When you run a program, Windows sets up an environment in which to run it (I mean in terms of memory, addressing, etc., not just environment variables). This environment depends on the contents of the executable (32-bit and 64-bit programs differ internally). When you run a 32-bit program on a 64-bit system, it runs in the 32-bit subsystem which emulates a 32-bit environment. It is called [WoW64][1] (WoW64 stands for [Windows on Windows 64-bit][2]) and is similar to how 16-bit apps would be run in XP using the [NTVDM][3].

When you run a program with or without admin privileges, it affects how it runs, but the location should not affect it (though there are some examples of location dependency like some drivers for example).

(I am using a different computer, so I cannot rely on my browser history to backtrack my steps, but the other day while answering this SU question I ended up at this SO question which caused me to Google PROCESSOR_ARCHITEW6432 which lead to this SO question and this Microsoft blog posting.)

Somewhere along the way, I read a StackOverflow post about how the envirnoment variable %processor_architecutre% gives different results depending on where you run the command-prompt from (I'll try to find the exact quote).

The answer turned out to be due whether the 32-bit or 64-bit version of the command prompt was run (i.e., from System32\ or SysWoW64\). In other words, while the location seems to affect the program's behavior, it is only because there are different versions of the program, not because Windows treats the folder in a special way.

This makes sense because the executable file's contents dictate whether it is 32-bit or 64-bit, so you could put both a 32-bit and 64-bit copy of the same program (e.g., foobar32.exe and foobar64.exe) in the same folder and when you execute them, they will be loaded correctly (the 64-bit version will be run natively and the 32-bit one will be run in the WoW64 emulation layer).

FreePascal allows you to install both DOS and Windows versions and they go in the same folder: %programfiles%\FreePascal. It manages the different architectures by keeping executable files (.exe, .sys, .dll, .ovr, etc.) in separate folders and sharing resource files like pictures, source-files, etc.) There is no technical reason that this could not also be done for 32- and 64-bit versions of a program. Like David said, it is just easier for the programmer if they are kept separate (i.e., using variables to make it look like there is only one set of files, etc.)

permanent link

answered 25 Nov, 06:12

arafat135's gravatar image

arafat135
292

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×12
×9
×1

question asked: 13 Jan '17, 08:29

question was seen: 1,049 times

last updated: 25 Nov, 06:12