2 ** show some memory stuff
4 ** 04-Aug-2004, Christian Groessler
13 extern int getsp(void); /* comes from ../getsp.s */
15 unsigned char data = 0x12; /* data variable */
17 unsigned int *APPMHI = (unsigned int *)14; /* 14,15 */
18 unsigned char *RAMTOP = (unsigned char *)106; /* in pages */
19 unsigned int *LOMEM = (unsigned int *)128; /* used by BASIC */
20 unsigned int *MEMTOP = (unsigned int *)741;
21 unsigned int *MEMLO = (unsigned int *)743;
26 allocmem = malloc(257);
30 printf(" RAMTOP = %02X (%u) - $%04X (%u)\n",
31 *RAMTOP, *RAMTOP, *RAMTOP * 256, *RAMTOP * 256);
32 printf(" APPMHI = $%04X (%u)\n", *APPMHI, *APPMHI);
33 printf(" LOMEM = $%04X (%u) <BASIC only>\n", *LOMEM, *LOMEM);
34 printf(" MEMTOP = $%04X (%u)\n", *MEMTOP, *MEMTOP);
35 printf(" MEMLO = $%04X (%u)\n", *MEMLO, *MEMLO);
37 printf(" ----------------------\n");
38 printf(" main: $%04X (code)\n", &main);
39 printf(" data: $%04X (data)\n", &data);
40 printf(" _dos_type: $%04X (bss)\n", &_dos_type);
41 printf(" allocmem: $%04X (dyn. data)\n", allocmem);
42 printf(" sp: $%04X (stack ptr)\n", getsp());
44 if (allocmem) free(allocmem);
45 if (doesclrscrafterexit()) cgetc();