Skip navigation

What is 16/32 bit programming?

Before knowing about programming, let us see what is 16 bit or 32 bit all about. The 16 or 32 bits, we talk about is nothing but the data bus width supported by the microprocessor. If a microprocessor can fetch 32 bits (4 bytes) of data during a memory read operation, it is called 32 bit microprocessor.

Intel followed 16 bit architecture till 80286 processor. The memory mode for this architecture is called Segmented memory mode. In this mode, each memory address is specified as segment and offset. It was a bit messy for programmers to handle these segment – offset concept. Here int data type in C, is 16 bits in size (2 bytes). Windows 1.0 to 3.1 followed this, which resulted in Win16 API.

From 80386 processor, Intel switched over to 32 bit architecture. It follows Linear memory model. No segment – no offset. C int data type has become 32 bits (4 bytes) and pointers are all 32 bits. Neat and clean. Starting from Windows 95 and NT 3.1, windows became 32 bit operating system which runs on 80386 and higher versions. This resulted in Win32 API.

What is Windows API?

User Program

Windows API

Windows Kernel and Device drivers

Hardware

Application Programming Interface (API) is the library offered by the Operating system to its developers to develop an application to run on this OS. Through API, a user mode program can access services offered by OS. There is a layer called System Call Interface, through which traditional UNIX programmers use to access OS services. Then why should we want Operating System Level API in Windows? Unlike UNIX, Windows abstract the many system call interfaces in to a single API call to make the programmer’s job easy ( 🙂 so that they can spend more time on forwarding emails and reading a round robbin mail for 10th time in a year). Apart from this, Windows has Graphical User Interface (GUI) as part of kernel. The graphical screen elements (Windows, buttons, menus, etc.) are simplified through API. This makes the programmers need not to worry about the finite element which is not related to the end user’s requirements. It is simple to call a function like CreatWindow() instead of calling many open,read and write system calls to create a window in screen. Since the API is implmented by the operating system, it knows the better way of calling system call interfaces.

Thank God, some how I have managed to justify my programming work on Windows API. 🙂

Advertisements

One Comment

  1. Good explanation. It would be more comprehensive if could throw light on 64 bit api programming. although it is now clear that 16/32 and I believe 64 (8 bits) also relate to micro processor i.e. it can fetch 64 bits (8 bytes) of data during a memory read operation.

    Did 64 bits microprocessor comes from the 80486 family ?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: