News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_freemac

Laser BASIC MEMORY &XXXX crash

Started by freemac, 20:03, 10 December 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

freemac

Hi,

Got problem using Laser BASIC compiler when I use "MEMORY &3999" in order to load my 11KB ASM routine into &4000.
Quote
10 MEMORY &3999
20 load"molusk2.bin",&4000
30 call &4000
40 ... my basic code
the program does crash after a certain number of basic jump (after a certain number of level loading) 

Compiled program does take 12-14KB, and seems load at &0100-&2EFF

Where can I add my ASM in MEMORY, without hurting the default MEMORY setting ? Can I reset my MEMORY setting after my LOAD instruction ?

AMSDOS

I don't know Laser BASIC all that well, in theory it looks fine apart from the MEMORY &3999 which could be at MEMORY &3FFF with your Assembly code beginning at &4000, the screenshot though shows a Runtime error produced by Laser BASIC though, which suggests something not being quite right perhaps between your source code and the assembly routine, though I don't know for sure.  :(
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

freemac


Looking around the "default HIMEM of LASER Basic", I found &0F22 (by snapshoot compare (x39,x33 = &3339), offset with this "RUNTIME" message error)
Quote10 MEMORY &3999
20 load"molusk2.bin",&4000
30 call &4000
40 MEMORY &F22
40 ... my basic code
As result I reach level 10 successfully, and then crash at begin of level 11.


I'll try &3FFF next time

freemac

Quote from: AMSDOS on 21:56, 10 December 19
I don't know Laser BASIC all that well, in theory it looks fine apart from the MEMORY &3999 which could be at MEMORY &3FFF with your Assembly code beginning at &4000, the screenshot though shows a Runtime error produced by Laser BASIC though, which suggests something not being quite right perhaps between your source code and the assembly routine, though I don't know for sure.  :(

Quote10 MEMORY &3FFF
20 load"molusk2.bin",&4000
30 call &4000
40 ... my basic code
Tested also OK, level 10 reached successfully, and then crash at begin of level 11.

I gave also a try just with
Quote10 MEMORY &3999
40 ... my basic code
got the same result with/without my ASM routine. Does crash also.

freemac

Quote10 MEMORY &6FFF
20 load"molusk3.bin",&7000
30 call &7000
40 ... my basic code
Level 67 (8 levels in fact) reached.

Got a bug at start, but in a string area, so it does not affect my code.

GUNHED

Quote from: freemac on 20:03, 10 December 19
Got problem using Laser BASIC compiler when I use "MEMORY &3999" in order to load my 11KB ASM routine into &4000.the program does crash ... snip


Well, first of all you should decide it you want to use decimal or hexadezimal code.


1. dezimal:
memory 3999
load"file",4000


2. hexadezimal:
memory &3FFF
load"file",&4000



http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

freemac

I have choosen HEXA  8)

I reach level 131 without ASM routine and then crash.

Got STRING garbage until &7000

freemac

#7
If I remove the "SCORE:" :
Quote280 'PRINT "SCORE:"+STR$(scoreP1%)+" -"+STR$(scoreP2%)
The last "PRINT USING FUNCTION" instruction used is some PRINT chr$(a%) used for drawing "Matrix level".

In dump I show that my routine starting at &7000 got eaten (laser_basic_matrixHexa.png)

If I remove Matrix level, and use this "SCORE:" formula :
Quote281 PRINT "SCORE:":LOCATE 7,21:PRINT scoreP1%:LOCATE 11,21:PRINT"-":LOCATE 12,21:PRINT scoreP2%
my LASER BASIC compiled program does grow only 24 bytes per level (laser_basic_skullDump.png)

GUNHED

Some code gets overwritten, maybe you can add some kind of 'trace' code to check certain RAM bytes (for a change), and then report the change. That way you can find out what's responsible.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod