Forum
This is weird - just plain won't run the code? - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15)
+---- Thread: This is weird - just plain won't run the code? (/showthread.php?tid=569)



This is weird - just plain won't run the code? - britlion - 09-05-2013

Input code:

Code:
BORDER 2
CLS
Print "Temp File"

(Originally it was just the one print line).

Out put file: <!-- m --><a class="postlink" href="https://dl.dropboxusercontent.com/u/4903664/LawOfChaos.zip">https://dl.dropboxusercontent.com/u/490 ... fChaos.zip</a><!-- m -->

This just crashes the Spectrum.

Build settings: zxb -T -B -a "LawOfChaos.bas"

C:\zxb --version
zxb 1.3.0-s1022

I haven't compiled anything up in a while. But...it's odd it seems to be making a broken result?


Re: This is weird - just plain won't run the code? - boriel - 09-06-2013

I can't reproduce the crash.
This runs ok. In the emulator. Are you running it on a real speccy? Which model?


Re: This is weird - just plain won't run the code? - britlion - 09-06-2013

I'm going to file this under "weird"

It works for me now as well. I don't actually own a real spectrum Wink I was, and still am, running it under spectaculator 8.0. It crashed last night each time. Today, it behaves....

Now I'm really baffled.


Re: This is weird - just plain won't run the code? - boriel - 09-06-2013

britlion Wrote:I'm going to file this under "weird"

It works for me now as well. I don't actually own a real spectrum Wink I was, and still am, running it under spectaculator 8.0. It crashed last night each time. Today, it behaves....

Now I'm really baffled.
Could it be you were running it on a non standard mode (e.g. +3, +2A, another clone)??


Re: This is weird - just plain won't run the code? - britlion - 09-07-2013

boriel Wrote:
britlion Wrote:I'm going to file this under "weird"

It works for me now as well. I don't actually own a real spectrum Wink I was, and still am, running it under spectaculator 8.0. It crashed last night each time. Today, it behaves....

Now I'm really baffled.
Could it be you were running it on a non standard mode (e.g. +3, +2A, another clone)??

Maybe. Not recoverable now. But it's a thought - perhaps it was left in an odd mode!


Re: This is weird - just plain won't run the code? - Darkstar - 09-16-2013

britlion Wrote:
boriel Wrote:
britlion Wrote:I'm going to file this under "weird"

It works for me now as well. I don't actually own a real spectrum Wink I was, and still am, running it under spectaculator 8.0. It crashed last night each time. Today, it behaves....

Now I'm really baffled.
Could it be you were running it on a non standard mode (e.g. +3, +2A, another clone)??

Maybe. Not recoverable now. But it's a thought - perhaps it was left in an odd mode!

I have had this problem and as it turns out the compiler did an "push hl" in the start up code just after the beginning RAND USR address or ORG, do not know why but there was no reason for it to be there and that is all I know.


Re: This is weird - just plain won't run the code? - boriel - 09-16-2013

Darkstar Wrote:I have had this problem and as it turns out the compiler did an "push hl" in the start up code just after the beginning RAND USR address or ORG, do not know why but there was no reason for it to be there and that is all I know.
If you can reproduce this, please tell me the steps. This will allow me to fix it. Which version were you using?
Usually an extra push hl means a bug in the optimizer (not removing it).


Re: This is weird - just plain won't run the code? - Darkstar - 09-16-2013

boriel Wrote:
Darkstar Wrote:I have had this problem and as it turns out the compiler did an "push hl" in the start up code just after the beginning RAND USR address or ORG, do not know why but there was no reason for it to be there and that is all I know.
If you can reproduce this, please tell me the steps. This will allow me to fix it. Which version were you using?
Usually an extra push hl means a bug in the optimizer (not removing it).

It was a while ago so I do not remember the -O level and I have not even tried to reproduce it. It was the second (after DI) or third instruction, very close to the beginning. Always kept crashing on me even though I recompiled until I found that extra "push hl" instruction and I thought "stupid stupid stupid, what is that doing there?" When I deleted both the TAP file I think it was and the ASM file and then recompiled then finally I got rid of that pesky "push hl" instruction. I do not think I changed the -O level. I have not had this bug since and I do not know how to reproduce it.