Page 1 of 1

Help understand where things end up in memory

PostPosted: Sun Mar 12, 2017 5:02 pm
by emook
Hello,

I've been using ZXBC for some projects I am doing, one of the things is that I working with very limited memory. I'm writing my code to start at 25000.

When I am doing an ASM include no matter where in the code I place it, there is still ZXBC code after.

If I place all my inlcudes at the end of my program, they still appear around 40-50 bytes in. I need to be able to tag the includes on at the end of the file, not in the middle as once I have moved them to another located they can be discarded but with ZXBC code appear AFTER the includes it means I keep running into trouble.

I know about ORG in ASM but I'd rather ZXBC obey me when I have a include as the last lines to see in memory that it also appears at the end of the code.

Any ideas?

Re: Help understand where things end up in memory

PostPosted: Wed Oct 25, 2017 6:17 am
by Luzie
I have a similar question:

How can I discover the size /end of the program ZXB compiles? I can have a look at size of.TAP-file created.

But more userfriendly would be if ZXB.EXE prints length or start and end when compiling ends. May I suggest this to be added to future ZXB versions? :lol:

Re: Help understand where things end up in memory

PostPosted: Thu Oct 26, 2017 9:56 am
by boriel
You can supply the --mmap=memory_map.txt file to the compiler, it will display a list of all the labels and their respective memory addresses.
Or also compile with -dd (or -ddd the more d's the more info). It will display all assembler instructions with it's resulting address.
Does this help?? :roll:

Re: Help understand where things end up in memory

PostPosted: Fri Oct 27, 2017 3:19 pm
by Luzie
boriel wrote:You can supply the --mmap=memory_map.txt file to the compiler, it will display a list of all the labels and their respective memory addresses.
Or also compile with -dd (or -ddd the more d's the more info). It will display all assembler instructions with it's resulting address.
Does this help?? :roll:

Yes. I like --mmap=memory_map.txt !
I know I should better read Help before posting ;-)

But one thing about it: Can you please add an option to generate a Memory-Map with decimal adresses instead of hex adresses?

Re: Help understand where things end up in memory

PostPosted: Fri Oct 27, 2017 8:22 pm
by boriel
Ok. Will take that into account.
Also, remember that in ZX Basic you can use hex numbers directly with any of these formats: 0xNNNN, 0NNNNh