Sooooo... I might be trying to put together a big basic program along a decent amount of graphics and some assembly functions together, but I'm struggling a bit.
Do I need to reposition the stack? How much stack space would be nice to have? I guess issue a proper CLEAR xx,yy command, etc...
Any help appreciated!
I'm talking roughly about 14KB Basic code and 19KB binary data and routines.
One obvious thing pops up right away it's that it would need a 64KB machine, and that begs another question: Would you people prefer a tape game that needs a 64KB machine, or would you prefer having it on disk but having to load some data while playing?
Cheers,
Rob
Basic and Assembly, how to?
Re: Basic and Assembly, how to?
Given that I have a Dragon 32 and no disk drive I prefer neither option
However, for an emulator I would prefer the 64kiB tape option.
- rolfmichelsen
- Posts: 331
- Joined: Wed Apr 08, 2009 8:43 pm
- Location: Oslo, Norway
- Contact:
Re: Basic and Assembly, how to?
I use a Dragon 64 with disk drives, and I'd love to see more software using that configuration. At the same time, I expect that limits the audience a bit among gamers preferring to run on real hardware...
Re: Basic and Assembly, how to?
Back to my question on mixing assembly routines with basic, if I understand it correctly, CLEAR 200, 19999 (for example) would tell Basic that it has 200 bytes for string somewhere and that I'm free to load my binary data/routines from 20000 until 32767. Is that right?
Where does the stack live?
Where does the stack live?
Re: Basic and Assembly, how to?
Yes. For the most part, you can sort of get away with CLEAR200,20000 but I think there's something to do with the operation of VAL() that can overwrite that extra byte. So stick with CLEAR200,19999.
The stack then begins below the allocated string space - seemingly minus another couple of bytes (which I would bet a pint is something to do with not bothering to adjust stack calculations between the 6800 and 6809 versions). So the first byte pushed to the stack will be at address 19999-200-2-1 (that last -1 allowing for the predecrement).
Note: actually the first byte written is one higher (19999-200-2), and is set to 0. Don't know why!
The stack then begins below the allocated string space - seemingly minus another couple of bytes (which I would bet a pint is something to do with not bothering to adjust stack calculations between the 6800 and 6809 versions). So the first byte pushed to the stack will be at address 19999-200-2-1 (that last -1 allowing for the predecrement).
Note: actually the first byte written is one higher (19999-200-2), and is set to 0. Don't know why!
Re: Basic and Assembly, how to?
Hi!
you are right, Robert
The stack would use from memory 19999-200 downwards, as shown in attached image
The graphics page(s), the Basic, variables and arrays will be able to use up to that 19798
but you should better make sure that the stack doesn't grow down enough to overwrite
your data (variables and arrays)
cheers!
you are right, Robert
The stack would use from memory 19999-200 downwards, as shown in attached image
The graphics page(s), the Basic, variables and arrays will be able to use up to that 19798
but you should better make sure that the stack doesn't grow down enough to overwrite
your data (variables and arrays)
cheers!
Re: Basic and Assembly, how to?
Thank you for your kind replies!
Let's put it to work...
Let's put it to work...