0

Please Help me This Question

On computers using the Intel 80n86 series of processors there are two different ways of storing an address. These may be called near and far . A near address requires 16 bits of storage whereas a far address requires 32 bits of storage. An actual far address is constructed from the sum of a 16 bit segment number and a 16 bit offset with a 4 bit overlap so it is effectively 28 bits long. Near addresses use less memory and can be manipulated more quickly and more simply. The use of near addresses implies a severe limitation on the amount of data a program can handle and on the amount of code that can make up the program.

  1. C compilers intended for use in such environments often have options to generate either type of address. The selection of such options is usually controlled from the compiler command line. The choices are usually called memory models.
    
  2. The Microsoft C version 5.1 compiler typically offers a choice of 5 memory models known as small, medium, compact, large and huge.
    

Compare and contrast various memory models with reference to pointer allocation and deallocation especially when multidimensional arrays are to be declared using pointers.

List data structure can be implemented using arrays and linked structures. Each technique has its own advantages and disadvantages

Edited by zahidpp: Title Change

2
Contributors
1
Reply
13
Views
3 Years
Discussion Span
Last Post by Ancient Dragon
0

It's unfortunate you are being forced to learn something that has been obsolete for nearly 20 years now. The problem you posted brings back a lot of fond memories of how we programmed in the late 1980s and 1990s.

Compare and contrast various memory models with reference to pointer allocation and deallocation especially when multidimensional arrays are to be declared using pointers

There is no difference. malloc() and free() are the same regardless of what memory model is used. And there is no difference in how multideminsional arrays are constructed. If you just state in a program
char* pointer The compiler will adjust the size of the pointer to the memory model being used. you can change that default behavior by using either the NEAR or FAR attribute, such as char FAR* pointer. In this case it will be a 32-bit pointer and the data reside anywhere within the 640K memory limitation. If you specify char NEAR* pointer the pointer will be a 16-bit pointer and the data to which it references will be expected to be in the same segment as the code segment (code and data reside in the same 64K segment of memory which is at most 16K).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.