Quote Originally Posted by dwks View Post
First of all, you probably don't want to do that. You'd only want to do that unless you're doing graphical stuff in mode 13h or something, and not only is that a bad idea, but you also need a DOS compiler to do it.

To answer your question:
Code:
short *memory = (short *)ADDRESSOFMEMORY;

*memory = 0x1111;
That should work, I think. You'll almost certainly get a segmentation fault if you try it with most modern compilers, however.
Thanks for the info. I am in a situation where I have to run a program like this.

Also what if I have to write at 4 consequetive memory locations (say e000h,e0002h, e0004h, e0008h) with the data 0x1111.

For example I have this pseudo code:

Code:
for(memoffset=0x0;memoffset<0x8;memoffset+=2)  
    {
	memory[memoffset]=data;   
    }
how can I build up a simple program using all the above.