home *** CD-ROM | disk | FTP | other *** search
- /* AddMem2 V1.0 by Steve Snodgrass */
- /* Compiled with SAS/C 5.10 */
-
- #include <exec/types.h>
- #include <stdio.h>
- #include <exec/memory.h>
- #include <clib/exec_protos.h>
- #include <pragmas/exec.h>
-
- void main(int argc, char *argv[]) {
-
- ULONG size, attr = MEMF_FAST|MEMF_PUBLIC;
- LONG pri = -1;
- APTR base;
-
- ULONG bot, top;
-
- if (argc < 3 || argc > 4) {
- printf("Usage: AddMem <lower hex address> <upper hex address> [priority]\n");
- printf("\nAddMem2 V1.0 by Steve Snodgrass, 1992 CPU - public domain\n");
- printf("Creative Power Unlimited - PD & FreeWare is us.\n");
- printf("The default memory priority is -1.\n");
- exit(0);
- }
- sscanf(argv[1],"%x",&bot);
- sscanf(argv[2],"%x",&top);
- if (argc == 4) pri = atoi(argv[3]);
- if (pri < -128 || pri > 127) {
- printf("Illegal priority - memory not added\n");
- exit(1);
- }
- size = top-bot+1;
- base = (void *)bot;
- AddMemList(size,attr,pri,base,NULL);
- printf("%dK added to memory: %6x - %6x\n",size/1024,bot,top);
- }
-