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