Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
where can I find free memory for data on the spectrum 48k if
#1
hello, good day.
where can I find free memory for data on the spectrum 48k if
I have made a program with zxbasic?

I want to move data with memcopy.

thanks.
best regards
Reply
#2
I'm not sure I did understand.
What are you trying to do?

You can declare DATA (READ, DATA, RESTORE are supported).
You can use alloc.bas library to allocate memory from the heap. And also configure the heap-size with compiling with --heap-size=NNNN being NNNN the size in bytes (the default is a bit more than 4Kb).
It is not recommended to shrink the HEAP below 1K.
Reply
#3
hello, thanks for the info.

where is the address of the free storage please?

greetings
Reply
#4
I don´t understand what do you mean by "address of the free storage".
ZX Spectrum is a very limited machine, it does not have an storage drive or disk.

If what you´re trying to do is to allocate a free block of memory (in the HEAP, dynamically) and get its address, you can do that with the alloc.bas library:

Code:
#include <alloc.bas>

Dim block As Uinteger
block = malloc(1024) : REM allocates 1k of mem, address in block

POKE block + 3, 5  : REM stores byte 5 at Block + 3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)