3.1 Portability

Under DOS and Windows 3.1, most NDIS 2.0 NIC drivers were written in 80x86 assembly language. These drivers had specific knowledge of how to handle interrupts, memory management, and programming I/O ports on the 80x86 platform for Windows and MS-DOS. Under Windows NT and Windows 95, these assumptions of how interrupts are processed and I/O and memory are handled are no longer valid. Therefore, these NDIS 2.0 NIC drivers do not operate under Windows 95 or Windows NT, even for Windows NT systems using an 80x86-based processor. Similarly, you cannot easily adapt such a driver to run on operating systems based on processors that are not 80x86-compatible.

For these reasons, you should develop your network driver in a high-level language, such as C or C++. Other languages can be used to implement network drivers, but they must maintain the exact semantics of the standard C interface conventions when calling functions. These considerations include how parameters are passed, stack cleanup conventions, registers that must be saved, and how values are returned by functions.

You can write portions of your driver in assembly language, but the parts that call NDIS interface library functions should be written in C. Since some of the NDIS interface library routines are actually C macros, you should not use assembly language to attempt to mimic C calling conventions. Furthermore, an NDIS library service implemented as a function now may change to a macro in a future version of Windows NT, or vice versa.