Thread: Compiler

  1. #1
    Anirban Ghosh
    Join Date
    Jan 2006
    Posts
    278

    Compiler

    What is meant by the terms "16 bit Compiler" and "32 bit Compiler"?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Code:
    sizeof( int )

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    http://en.wikipedia.org/wiki/16-bit
    In computer architecture, 16-bit integers, memory addresses, or other data units are those that are at most 16 bits (2 octets) wide.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    A 16-bit compiler is a compiler that produces an executable that runs on a 16-bit platform, such as for a DOS system, or Windows 3.1.

    Similarily, a 32-bit compiler would be a compiler that produces an executable that runs on a 32-bit platform, such as Windows 95, Windows 98, Windows XP, etc. etc..

  5. #5
    Anirban Ghosh
    Join Date
    Jan 2006
    Posts
    278
    Thank you..But in C/C++ which are 16bit and which are 32bit ones?

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    16 bit and 32 bit do not have any meaning relative to C and C++.

    A 16-bit application is an application will run natively under a 16 bit operating system (such as MS-DOS) and a 32-bit application will run natively under a 32-bit operating system. (Running natively means that the application does not rely on some form of emulation to run; a 16 bit application can run on a 32-bit operating system, if the 32-bit operating system provides some means of making the application believe it is running under a 16 bit operating system. This is the reason that some old MS-DOS applications can run under recent versions of windows -- the operating system emulates the older 16-bit environment as far as those applications are concerned).

    A compiler is an application (or a suite of applications) in its own right. If the compiler executes natively on a 32 bit operating system, it is a 32-bit application. If it generates code (object files and executables) that run natively on a 32-bit operating system, it is said to target a 32-bit operating system. The term "32-bit compiler" is a bit of a misnomer, as it mixes those concepts; it probably describes a compiler that is a 32-bit application and which, when run, produces programs that execute natively under a 32 bit operating system.

    sizeof(int) is not specifically related to a compiler being 16 or 32 bit. sizeof(pointers) (eg sizeof (void *)) is more closely related. For example, a pointer will nominally be 4 bytes (each byte containing 8 bits) when the compiler is producing native 32-bit applications.
    Last edited by grumpy; 03-24-2007 at 12:33 AM.

  7. #7
    Anirban Ghosh
    Join Date
    Jan 2006
    Posts
    278
    So when we run a C/C++ program under an IDE such as Dev C++, CODE BLOCKS, VC++ 6.0 do they simulate the DOS environment? If yes then why?

  8. #8
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by anirban
    So when we run a C/C++ program under an IDE such as Dev C++, CODE BLOCKS, VC++ 6.0 do they simulate the DOS environment? If yes then why?
    No they don't

    Console application is 32-bit application
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  9. #9
    Anirban Ghosh
    Join Date
    Jan 2006
    Posts
    278
    Sorry, my conception is not so clear..I shall beg your pardon if I say wrong..

    If they do not simulate then why a DOS like window comes up, when we run?

  10. #10
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by anirban
    Sorry, my conception is not so clear..I shall beg your pardon if I say wrong..

    If they do not simulate then why a DOS like window comes up, when we run?
    In windows there ARE console applications that are shown using black box. These applications ARE still 32-bit...

    ONE of these console applications is DOS emulator. Once you run DOS 16-bit program windows start this 32-bit application for you openning black box window and then runs a DOS application inside this emulator. This is the reason that all DOS applications you run are shown in the black window, but not all black windows are assotiated with DOS applications
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  11. #11
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    PS. Not all 16-bit application are Console... There are 18-bit applications written for example for Win3.x that have GUI
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  2. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  3. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  4. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM