(09-22-2021, 07:45 PM)maeloterkim Wrote: Hi
In the normal basic of zx spectrum 48k there is a behaviour or trick like this
you can change the address of DEFADD variable
and after this you can copy bytes very fast Is like an assembler LDIR
I will explain more
you can have 2 variables A$ and B$ for example
every one of this variables can have 1000 bytes
when you do A$ = B$ the 1000 bytes of B$ are copied on A$
Normally DEFADD points to the beginning of the variables definitions
for example (invented numbers)
DEFADD_POINTER_ADDRESS ;;'' defadd initial definitions of variables
A$ begins on 30000 and have 1000 bytes of size
B$ begins on 32000 and have 1000 bytes of size
etc ...
[...]
I tried this trick with compiled zx basic but is not working because seems
that string variables are not doing the same behavior that original ROM
You don't need this in ZX Basic. Use memcopy:
Code:
#include <memcopy.bas>
memcopy(32768, 16784, 256)
The above code copies from 32768 (source) to 16784 (dest) 256 bytes.
Hope this helps!
EDIT: I'm documenting the standard library bundled with ZX Basic, as it includes many things, like scroll, sprites (faster than print), etc. etc.