What is the difference between small memory model and large memory model


what difference does it make when i choose 'large memory model' instead of 'small memory model' inside Turbo C compiler ?

how does that change behavior of my program ?


Best Solution

It refers to very old concept of 16-bit memory model. 32bit & 64bit computers know nothing about these memory models.

So returning to your questions: small - declares that pointers allows you address only 64k of data or code. Pointer has length 16 bit. Entire your program is resided in single 64k segment. To explicitly address another part of memory you need explicitly declare pointer as FAR. large - declares that pointer to code or data has 32 bit, so it is FAR by default.

Hope you would not hang on these questions so long, since it is obsolete concept.