Help, my stack is full!

46 views
Skip to first unread message

Carl Attrill

unread,
Jul 12, 2014, 6:05:55 AM7/12/14
to fign...@googlegroups.com
I wrote lawn mower simulator when we were on firmware 0.98 but now I have converted it to audio I get 'Stack full in man'

Can anyone help! :-) as I used the same technique in Blitz! with Julz and David, I would expect this problem to come up in most of the programmes I have typed up.

Can someone load this in try is and see where it is wrong?

6 ear
then 
run <exe> and choose m6 <m6>

or you can just type mow to cut the intro, hold down 'm' to mow!

big mega thanks.

regards.
LMS.fth

Julian Skidmore

unread,
Jul 12, 2014, 11:30:24 AM7/12/14
to FIGnition

Hi Carl, well at least it warns you these days ;-)

One thing to bear in mind is that on current firmware jumps are limited to +/- 128 bytes. So if there's a lot of code between any:

If .. Else .. Then
Begin .. While .. Repeat
Begin .. Until
Do .. Loop

It might be too much. You'll have to split the code up a bit to keep it in range.

Bug fix in pipeline.

Cheers julz

--
You received this message because you are subscribed to the Google Groups "FIGnition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fignition+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

david richards

unread,
Jul 12, 2014, 12:32:34 PM7/12/14
to fign...@googlegroups.com
Hi Carl,
Ive loaded LMS.fth and ran it and it does trhe same for me too. I tried adding a 100 pause into the main (mow) loop and it then allowed me to play for a minute (I cut two rows of grass) before it crashed out again.

perhaps a stack dump word added somewhere would allow you to debug the fault - where is the source for .S (the non destructive stack print) ? it could help trace the fault.

David.

Si Brindley

unread,
Jul 12, 2014, 1:11:40 PM7/12/14
to fign...@googlegroups.com
: .s
sp i@ sp0 do
i i@ .
2 +loop
;

david richards

unread,
Jul 12, 2014, 3:57:06 PM7/12/14
to fign...@googlegroups.com
Greetings Si. It makes nice change to see forth code nicely indented. Thanks, David.

Si Brindley

unread,
Jul 12, 2014, 4:01:45 PM7/12/14
to fign...@googlegroups.com
I should say: original credit to Julz, who just nonchalantly spat it out in the middle of one of my early questions ;)

On Sat, Jul 12, 2014 at 8:57 PM, david richards <richard...@gmail.com> wrote:

Greetings Si. It makes nice change to see forth code nicely indented. Thanks, David.

david richards

unread,
Jul 12, 2014, 6:13:46 PM7/12/14
to fign...@googlegroups.com
Armed with .s  I find that the stack is growing every time through the main loop.
removing the end function cures the problem but something is still not right.
I cant understand what the end is there for, what is the purpose of the end? function, are they mixed up somehow?

...
has the definition '0 var end' been added to make it compile because end? was mistyped instead of end at some time 
The game in not very entertaining but it shows that the sound is working on my figy. 

If I rewrite the last few lines like this then everything seems ok :-)

: end? die?
man @ 250 = if win then ;

: mow
 573 man ! 
 aud 
 cls ground sun house 
 begin 
  dokey 
  char
  end?
  99 = until 
;


hth David.

Mark Wills

unread,
Jul 12, 2014, 6:23:54 PM7/12/14
to fign...@googlegroups.com

Needs stack comments! ;-)

--

carl

unread,
Jul 12, 2014, 6:24:39 PM7/12/14
to fign...@googlegroups.com

Thanks David, I will add that to my code.The game is a conversion from a self acclaimed 'crap game' by Your Sinclair magazine for the ZX Spectrum, So your critique of it is spot on :-)

Carl Attrill

unread,
Jul 13, 2014, 3:32:59 AM7/13/14
to fign...@googlegroups.com
HI again David,

I made the changes, Brilliant work, you are right about the 0 var end, I did add that at the last minute to compile, I guess as that as I wrote all the programmes on FIGnition and then copied them to the PC I missed the ? for end. Thats is where I compounded the problem.

My fth files are somewhat messy as their sole purpose was to convert to hex files via t2e2, in the very early days every space in your text was a byte so all the data was squashed up to fit it into one 512 b block so I could keep transfers with avr dude to a minimum. Now that this is not an issue I will have to learn to set the listings out in a better way and add comments too.

I am pleased your sound works ;-)

Regards.

here is the corrected .wav file ​






--

david richards

unread,
Jul 13, 2014, 3:52:08 AM7/13/14
to fign...@googlegroups.com
Greetings Carl,
I nearly didnt bother with my fignition because of the file transfer difficulties of the previous version.
Im using mine with an arduino as a usb com port to keyboard converter and usb video capture card. Hardly standalone atm is it.
I can use it just connected to a tiny 2.5 inch lcd monitor as sold for car reversing aid but the text is just a bit too small to read clearly.
Im thinking of making a case for it if I can find a design to adapt to suit...
Kind regards, David
Reply all
Reply to author
Forward
0 new messages