|
|
1.1 root 1: /*
2: / sysmm- get more memory
3: /
4: / Parameters:
5: / None
6: / Returns:
7: / Number of additional words obtained (or 0 if none) in XR.
8: */
9:
10: #include "osint.h"
11: #include "spitblks.h"
12:
13: extern WORD meminc;
14: extern WORD memincb;
15: extern char *topmem;
16: extern char *maxmem;
17:
18: extern char *sbrk();
19:
20: sysmm()
21:
22: {
23: /*
24: / Default situation is that no more memory is available.
25: */
26: SET_XR( 0 );
27:
28: /*
29: / If not already at maximum allocation, try to get more memory.
30: */
31: if ( topmem < maxmem )
32: {
33: if ( (long) sbrk( memincb ) != -1 )
34: {
35: topmem += memincb; /* adjust current top address */
36: SET_XR( meminc ); /* set # of words obtained */
37: }
38: }
39:
40: return NORMAL_RETURN;
41: }
42:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.