answersLogoWhite

0

You've answered your own question, I'm afraid. A 16-bit memory address requires 2 bytes of storage (8 bits * 2 bytes = 16 bits). Note that, without using XMS or EMS, you can only address 2^20 bytes of memory, with the last 384k or so being restricted (BIOS, video, etc) unless you enable the A20 line (it actually wraps from FFFF:0010 back to 0000:0000). Also, you should note that 16-bit pointers work because of a "segment:offset" feature; your current "data segment" determines where in memory your pointer actually points to. If you need a 4-byte pointer, use a far pointerinstead; these pointers can reference any point in memory (up to the aforementioned 1MB limit).

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How many bytes does null occupy?

In most languages with a null reference, it is simply a memory address to a zero-length memory block. So the only memory it would occupy in these cases would be enough for a memory pointer: usually around 4 bytes.


How many bytes of memory does an integer occupy?

4 bytes


What is short and long pointer?

A short pointer typically refers to a pointer that occupies fewer bytes (usually 2 bytes), while a long pointer is a pointer that occupies more bytes (usually 4 or 8 bytes) to represent memory addresses in computer programming languages. Short pointers are more limited in the range of memory addresses they can access compared to long pointers.


How many bytes are required to store the pointer?

It depends on the platform... In a 16 bit environment, such as DOS or Windows 3.x, a near pointer is two bytes, while a far pointer is 4 bytes. In a 32 bit environment, such as Win32, a pointer is 4 bytes. In a 64 bit environment, such as Win64, a pointer is 8 bytes. If you want to find out in your particular environment, look at sizeof(ptr), where ptr is declared as a pointer to something. char* ptr; std::cout << sizeof(ptr) << std::endl; Note that the size of the pointer is not the same as the size of the object to which it points. If you looked at sizeof(*ptr), you would get 1.


How many bytes does date DD-MM-YYYY datatype occupy in java?

A java.util.Date object will take about 32 bytes in memory.


How many bytes in a pointer address?

Suppose that we're talking about C on an x86 32-bit processor it should be 4-bytes (32-bits). Since the pointer has to be able to hold any memory location it should be the same number of bits as the processor.


How many types of pointers are there?

That depends on what you consider a type. A pointer variable simply stores a memory address or NULL so, strictly speaking, there is only one type of pointer. A pointer variable's type (int *, char *, void *, etc) determines the type that a pointer points to, not the type of the pointer itself. Whether a pointer points to a primitive type, a user-defined type, a function, another pointer or void, makes no difference to the pointer variable itself. It simply stores a memory address. How you treat that memory address is determined by the pointer variable's type. So, in that respect, there are as many types of pointer as there are types to point at; which would be infinite. The architecture determines the size of a pointer variable. On a 16-bit system, a pointer will occupy just 2 bytes, while on a 32-bit system it occupies 4 bytes and 8 bytes on a 64-bit system. Although these may be considered separate pointer types, you can't pick and choose which type you use. The size must be consistent for any given architecture, hence the prevalent use of the sizeof() operator to determine a variable's length at runtime.


How many bytes are read in pointers by pointers dereferencing?

When you dereference a pointer you "read" the number of bytes determined by the pointer's type. That is, a char pointer dereferences a single byte while an int pointer dereferences 4 bytes (assuming a 32-bit int) -- regardless of the type actually stored at that address. However, note that a pointer can only actually point at a single byte since it only has storage for a single memory address. How many additional bytes are dereferenced is entirely dependant on the type of the pointer. To determine how many bytes are actually allocated to an address, use the sizeof operator, passing a dereferenced pointer (the pointer must point at the start of the allocation). If the pointer points at several elements of the same type (an array), then divide the total bytes by the size of the pointer's type to determine the number of elements in the array.


Do reference variables occupy memory in c?

All references must be non-null, therefore they will always have memory allocated to them. A reference is simply a non-null memory location that stores a specific type of variable, as determined by the reference's type. The reference name is an alias (a token) for the memory location, in much the same way that an array name is an alias for the starting address of the array. A pointer variable is different in that memory must be set aside for the pointer variable itself, in addition to the memory it actually points to. On a 32-bit system, 4 bytes must be allocated to every pointer variable, to store the memory address that they point to, which could be null. But references only occupy the memory they actually refer to, which can never be null (a null reference will in fact render the program invalid).


What is pointer in computer language?

A pointer is a variable, much like any other variable, but one that contains a value that is interpreted as a memory address. The variable is said to "point" at that address. In 32-bit systems, the variable is 4-bytes in length. In 64-bit systems it is 8-bytes in length. If the value is zero the pointer is said to be NULL -- it doesn't point anywhere. Any other value denotes the pointer is pointing at a memory location. The type of pointer determines how it treats the memory it is pointing at. For instance, an int pointer treats the memory location as if it contained an integer -- regardless of its actual type. We can access the memory location itself by using the indirection operator (-->). Providing the pointer is the correct type for the object stored in that memory, we can work with the object just as if we had a direct reference to the object.Pointers are extremely powerful. By altering the value stored in the pointer, the pointer can be made to point at any memory location -- including other pointer variables, objects and values, even functions. Pointers also allow us to pass memory locations to functions, in much the same way as we can pass values to functions. And like all other primitives, we can use simple mathematics to adjust a pointer's value, such as increment and decrement, allowing the pointer to "roam" through a series of memory locations.


Ram memory is measured in bytes how many bytes are there in 2gb of ram memory?

2147483648 bytes


How much in is a pointer?

In C and C++, the size of a pointer depends on the architecture of the system. On a 32-bit system, a pointer typically occupies 4 bytes, while on a 64-bit system, it generally occupies 8 bytes. However, the actual size can vary depending on the compiler and the specific platform being used. To determine the exact size of a pointer in a particular environment, you can use the sizeof operator.