Forum
Memory Map - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Wishlist (https://www.boriel.com/forum/forumdisplay.php?fid=14)
+---- Thread: Memory Map (/showthread.php?tid=181)



Memory Map - britlion - 03-14-2010

It would be nice to be able to map the program produced in memory, work out where it is - and optionally, where gaps are (very useful for IM2 stuff) so that the gaps could be used. Even if only as buffer memory for other functions.


Re: Memory Map - boriel - 03-14-2010

This has already been requested by LCD, I think. But there are two things to keep in mind:
  1. This applies mostly to Speccy, not to a generic machine architecture.
  2. This is very low level (not high level, like BASIC).
So perhaps this should go in the assembler (zxasm).

As far as I know, no compiler does that currently. The closest approach is the INTERRUPT subroutine in Borland Turbo Pascal, as far as I can remember.
Since creating an IM2 routine does not imply the whole routine should go in a memory zone (a single JP in that memory zone should be OK), this could be left to the compiler.

Anyway, a Memory Map Report (as LCD suggested) would be nice. You can later create a routine at empty places with ASM + ORG XXX. The best way to do this could be a DIM AT @XXXXX array of bytes, with the bytes containing the machine code, at the moment, I guess.


Re: Memory Map - britlion - 03-17-2010

I was also thinking that if we have un-moveable code, it would be good to know whether our main program and includes are overwriting it! Smile