Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiles OK then crashed
#1
Hi,

I've been trying to convert Telengard from Commodore BASIC to Sinclair BASIC - originally targetting a 32K expanded ZX81 for fun

I quickly discovered that although porting the cut-down Vic-20 version of Telengard that I made some years ago (around 26K) into Sinclair BASIC meant that all those wonderful LET and GOTOs had to be included, in addition to carving up each command onto it's own separate line. In addition to that I had to deal with multiple variable clashes (no two-letter string names, no arrays starting from 0, etc). These set-backs in turn pushed the size of the program well above the original 32K in the text file, so the result I achieved so far was hard won - and to be honest it's a little incomplete in some areas and unfinished. I just wanted to see that I had *something* that would work for now.

ZX81 text to program converters were telling me that the program was just too big.
I turned to BASIC compilation. If I can't get this to run on a ZX81, let's try the 48K speccy.

This might have been a good idea, assuming the compiled program may well be smaller than the original BASIC listing, but it would appear that the tape file created is around 48K in size. Upon loading the compiled program into the emulator, crashes are occurring - despite having completed successful compilation of the code. The crashes seem to differ every time I remove/add lines etc - which makes me think that I've found the 48K Speccy's upper limit of memory. Doesn't even work on a 128K speccy though, so I dunno....

Attached is the text file I have been working from. It compiles OK with the command: 
.\zxbc -taB --sinclair teleng.txt

...but the output won't start in the emulator (I'm using FUSE if that makes a difference)
Is the resulting program just too big to ever work? If so, short of hacking the program down further, is there any way to compress it from the compiler options?
If there's any bugs in the compiler (or I have the wrong options), then I suspect you'll find them thanks to this listing.


Attached Files
.txt   teleng.txt (Size: 47.4 KB / Downloads: 239)
Reply
#2
By default the compiled program starts at 32768 (Upper 32K of memory).
Try compiling with --org 26000 for example and see if it works (it gives you 6k more of memory).


What compiler version are you using?
Reply
#3
(05-30-2023, 10:11 AM)boriel Wrote: By default the compiled program starts at 32768 (Upper 32K of memory).
Try compiling with --org 26000 for example and see if it works (it gives you 6k more of memory).


What compiler version are you using?

Tried --org 26000 but that resulted in a crash too
Tried lower than 26000 but got the error RAMTOP no good.

Using the latest stable 1.16.4
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)