|
-
Jun 8th, 2003, 12:13 AM
#1
Thread Starter
Fanatic Member
Dynamic Allocation?
Is there a way to dynamically allocate memory in the data segment? If so, how?
-
Jun 16th, 2003, 04:23 AM
#2
Which data segment? The segment referenced by ds or the .data segment in your exe?
Dynamic allocation is OS-dependent. In Windows, you must call one of LocalAlloc, GlobalAlloc, HeapAlloc or VirtualAlloc (with the first two being deprecated). In Linux there's some system call too. In DOS, you need to implement a memory manager (I think).
And of course you can't dynamically allocate space within your exe.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 18th, 2003, 03:53 PM
#3
Thread Starter
Fanatic Member
Well this is all implemented for as a 16-bit DOS .exe (after linking of course.) I could use either DS or ES (maybe FS or GS if need be)
This is all in assembler. Not one bit of it is in a higher level PL. (A very sick learning activity that I assigned myself so to learn the second of the five PLs that I need to know.)
I might be able to implement a memory manager if need be and give an overflow if there is a problem. If you have any sources to accomplish this, please share.
-
Jun 18th, 2003, 04:53 PM
#4
I have this:
http://cboard.cprogramming.com/
They have a DOS board, and as I never have programmed for DOS (too young back then) I don't know that much about it.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 18th, 2003, 06:03 PM
#5
Thread Starter
Fanatic Member
Basically, this is for a MS-DOS window that does not use the protected features of the processor.
Thx for the source though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|