Login
Forum Help



Post Your Message
Username: (Login)

Topic:
Message:
 


Previous Messages
Posted By

MMS
on 2025-03-10
19:26:23
 Re: Out of Memory

remark:
if fact there is no such thing on Commodores as real Integers. Every number and variable stored and handled as floats in the high precision Commodore format. (if I remember well, it is more precise than the Intel float and the standard float, but why? happy )

If you predefined a variable at a forced integer, like A%=1, it will make EVEN slower.
Only in Austrospeed you can have a real benefi from thator in @Litwr 's compiler, changes it to a real integers and even floats turned into a more compact and faster float number.

https://www.youtube.com/watch?v=wo14rDnGUbY

Posted By

Haegar
on 2025-03-10
16:23:19
 Re: Out of Memory

I have now found a solution without having to move the basic start. I suspect that it's really the phenomenon described by @TCFS . Is there a way to just delete the stack? With the CLR command I also delete all variables, right?

If we can solve the problem, then I think I haven't spent the last few weeks on the computer for nothing.

Thanks again to everyone for the help and tips.

Posted By

Csabo
on 2025-03-10
08:15:08
 Re: Out of Memory

For the latter - that will be a GOTO. There's no "shortcut" for the GOSUB statement, that one must be fully written out each time.

Posted By

Haegar
on 2025-03-10
07:51:03
 Re: Out of Memory

That could be the case. I have a subroutine that I call very often using GOSUB and it also contains a FOR... NEXT loop. I actually built it in to save memory happy

Shouldn't the stack go down again after the RETURN?

Another question in this context, if I write

IF A$="Y" THEN 1000

Will GOTO or GOSUB be executed?

Posted By

TCFS
on 2025-03-10
03:59:52
 Re: Out of Memory

Out of memory error can also appear in case of stack depletion. When you have deep recursions, so many embedded gosub and-or for...next iterations, this can also happen.

Posted By

Haegar
on 2025-03-09
15:32:08
 Re: Out of Memory

Unfortunately, that didn't help either.

I have 2 challenges

1) If I do it as before, the error message "Out of Memory" will appear at some point even though there is still enough memory available.

or

2) I move the memory for the variables and the Basic Interpreter can no longer do 1=1 but 1 = 1.001046

Are there any other ideas?

Posted By

SVS
on 2025-03-09
12:25:02
 Re: Out of Memory

Add line:
45 CLR

Posted By

Haegar
on 2025-03-09
11:43:37
 Re: Out of Memory

Unfortunately it doesn't work. The Basic program is 29246 bytes long and starts at $3800 (14336), so the Basic end would be at $AA3E. Since I'm not quite finished yet, I thought I'd start at $D000 for the variable start.

What I also noticed is that the values ​​are suddenly no longer integer numbers, for example if I say LO=1 and then PRINT LO, something like 1.00104165 comes out.

Here is an example of my program to load the basic program to $3800

10 poke43,01:poke44,dec("38")
20 poke45,01:poke46,dec("d0")
30 poke47,02:poke48,dec("d0")
40 poke49,03:poke50,dec("d0")
50 poke dec("3800"),0
60 dL"basic prog"

If I do it in the game, then of course it would only be lines 20-40.

At the moment I think the problem is that they are not INTEGER numbers, so if 1 is not 1 but 1.001046 sad



Posted By

SVS
on 2025-03-09
10:45:41
 Re: Out of Memory

@Haeger:
- you can set the pointers even from inside the program running, if you have not used any variable yet.
- After a prg SAVing, the cells $2D-$2E give the (end address+1) of the saved program. Then:
MONITOR [return]
M 2D 2E [return]

Posted By

Haegar
on 2025-03-09
09:58:17
 Re: Out of Memory

Thanks for the info, I'll try moving the pointer again. Can I do that from the program or should it happen before loading? As I said, changing the pointer has crashes the game.

Is there a way to check the basic end?

Posted By

Csabo
on 2025-03-09
09:19:24
 Re: Out of Memory

Not setting the pointers correctly will definitely prevent your program from running. Each of these pointers should always be higher than the one before (or equal):

$2B-$2C: Start of BASIC program
$2D-$2E: Start of variables (End of BASIC program +1)
$2F-$30: Start of arrays (End of variables +1)
$31-$32: End of arrays (Start of free RAM)

Your program starts at $3801 and ends at $XXYY, you should set $2D-$2E to YY XX, and same for $2F-$30, $31-$32. Then, as you allocate variables, the BASIC interpreter will take care of updating those normally.

Posted By

Haegar
on 2025-03-09
08:42:09
 Out of Memory

I have a problem with my new game. After a certain amount of time in the game I get the error "? OUT OF MEMORY IN .....".
It always occurs differently. What they all have in common is that the line uses variables. They are not "new" but always ones that have already been called several times. For my game I moved the basic start to $3800, but not the variable start. The reason for this was that the game did not start with the changed variable start sad does anyone have any idea how to solve this?




Copyright © Plus/4 World Team, 2001-2025. Support Plus/4 World on Patreon