Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Memory used ?
#5
(03-13-2021, 02:10 PM)RandomiserUsr Wrote: I wonder if there is a way to print the available memory your compile ZX Basic program has used whilst running it?

One more question on memory usage, which would be better in terms of reducing memory overhead?

1) IF WORD$ = "SAVE WORLD" THEN


or
2) IF WORD = 99 and WORD=98 THEN

thanks in advance
Ken

Using numbers will be always faster and shorter. A string is an array of bytes. A number will take 1-2 bytes. This is called "tokenization", and it's used in many text adventures, for example.

To compress text you can also use digraph and trigraph or other compression techniques (search in this forum). ZX Basic will also try to map repeated strings into a single memory region, whenever possible (there's still work to be done on this).
Reply


Messages In This Thread
Memory used ? - by RandomiserUsr - 03-13-2021, 02:10 PM
RE: Memory used ? - by georgeo - 03-13-2021, 03:02 PM
RE: Memory used ? - by RandomiserUsr - 03-13-2021, 03:16 PM
RE: Memory used ? - by boriel - 03-14-2021, 11:37 AM
RE: Memory used ? - by boriel - 03-14-2021, 11:39 AM
RE: Memory used ? - by georgeo - 03-14-2021, 12:53 PM
RE: Memory used ? - by boriel - 03-14-2021, 04:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)