Thread: simple question

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    184

    simple question

    hello guys,

    can any one tell me what is this 16bit code and 32 bit code. how does it relate to programming in c. i cant really understand

    thanks very much

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    The bits are the width of the register. The more bits a register is wide the more data can be used on them at one time. Data is represented on different ways but i dont think it should really affect the way you are programming in c. Unless you are using in line assembler or something like that. The compiler takes of care of assembling for 16, 32 or 64 bit compiling.

    Windows 3.11 is an eg of a 16 bit Operating system
    windows 2000 is an eg of a 32 bit operating system

    hope this helps
    Monday - what a way to spend a seventh of your life

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    The 16 or 32 basically relates to the native word size of your compiler/operating system. It also relates to how the operating system handles the segmented memory architecture of Intel x86 processors.

    16 bit code was typical for DOS programming. Here your segments are addressed using 16-bit numbers (hence the occasional comment, how do I allocate more than 64K).

    32 bit code is typical for console and GUI programming (in windows). Segments here are 32-bit, which is a 4GB range (more than enough right?)

    C itself doesn't care, because it runs on many more processors than just Intel, most of which do not use memory segments.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple question regarding variables
    By Flakster in forum C++ Programming
    Replies: 10
    Last Post: 05-18-2005, 08:10 PM
  2. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-20-2005, 11:41 PM
  3. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 09:46 AM
  4. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 12:15 PM
  5. simple fgets question
    By theweirdo in forum C Programming
    Replies: 7
    Last Post: 01-27-2002, 06:58 PM