Pre-Assemble or Discard ASM program lines once runtime assembled.

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
alecb
Posts: 12
Joined: Thu Feb 22, 2024 9:22 pm
Contact:

Pre-Assemble or Discard ASM program lines once runtime assembled.

Post by alecb »

I've been writing my first BBC Model B game in over 40 years. It's 95% in assembler and almost complete but I am running into memory issues with having the ASM as part of the single source file and relying on both the assemble machine code and the source ASM being in runtime memory. I'm already reclaiming the 3.5K for the DFS and that may be enough but I'd like to avoid the memory copy at startup time.
I see mentions of techniques for solving this either with chaining programs or with pre-assembling the machine code and embedding it as data with machine code entry points exposed as variables.
I see how each of these techniques might work but I haven't been able to find a clear article or video explaining the techniques with an example. I like the idea of pre-assembling but I don't know of a suitable external assemble to use or how to export function addresses to call from basic.
Does anyone know of a good learning resource for these techniques, or have any other advice on how to proceed?
User avatar
IanS
Posts: 2541
Joined: Mon Aug 31, 2009 7:02 pm
Location: UK
Contact:

Re: Pre-Assemble or Discard ASM program lines once runtime assembled.

Post by IanS »

Have you seen this - viewtopic.php?p=358007#p358007
It might give you some ideas.
alecb
Posts: 12
Joined: Thu Feb 22, 2024 9:22 pm
Contact:

Re: Pre-Assemble or Discard ASM program lines once runtime assembled.

Post by alecb »

"Have you seen this - viewtopic.php?p=358007#p358007"

Thanks for the link to the topic Ian. Is this tool what people are using to solve this issue? It seems very powerful but it may be overkill for what I am trying to achieve. I feel that if I use this I won't actually learn anything other than how to use the tool. The tool was only introduced in 2022, what technique were devs using before this?
User avatar
IanS
Posts: 2541
Joined: Mon Aug 31, 2009 7:02 pm
Location: UK
Contact:

Re: Pre-Assemble or Discard ASM program lines once runtime assembled.

Post by IanS »

I think the crazee rider source has the original build system, That's definately how it was done back in the day. (Also been updadated to build with beebasm)

https://github.com/KevEdwards/CrazeeRiderBBC
Post Reply

Return to “programming”