Author Topic: Laser BASIC MEMORY &XXXX crash  (Read 499 times)

0 Members and 1 Guest are viewing this topic.

Offline freemac

  • 464 Plus
  • *****
  • Posts: 326
  • Country: 00
  • Liked: 253
  • Likes Given: 250
Laser BASIC MEMORY &XXXX crash
« on: 21:03, 10 December 19 »
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 ?
« Last Edit: 21:45, 10 December 19 by freemac »

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.893
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1104
  • Likes Given: 1869
Re: Laser BASIC MEMORY &XXXX crash
« Reply #1 on: 22: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.  :(
* 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

Offline freemac

  • 464 Plus
  • *****
  • Posts: 326
  • Country: 00
  • Liked: 253
  • Likes Given: 250
Re: Laser BASIC MEMORY &XXXX crash
« Reply #2 on: 23:02, 10 December 19 »

Looking around the "default HIMEM of LASER Basic", I found &0F22 (by snapshoot compare (x39,x33 = &3339), offset with this "RUNTIME" message error)
Quote
10 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

Offline freemac

  • 464 Plus
  • *****
  • Posts: 326
  • Country: 00
  • Liked: 253
  • Likes Given: 250
Re: Laser BASIC MEMORY &XXXX crash
« Reply #3 on: 23:13, 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.  :(

Quote
10 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
Quote
10 MEMORY &3999
40 ... my basic code
got the same result with/without my ASM routine. Does crash also.

Offline freemac

  • 464 Plus
  • *****
  • Posts: 326
  • Country: 00
  • Liked: 253
  • Likes Given: 250
Re: Laser BASIC MEMORY &XXXX crash
« Reply #4 on: 13:19, 15 December 19 »
Quote
10 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.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.974
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 891
  • Likes Given: 2222
Re: Laser BASIC MEMORY &XXXX crash
« Reply #5 on: 15:08, 15 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 (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline freemac

  • 464 Plus
  • *****
  • Posts: 326
  • Country: 00
  • Liked: 253
  • Likes Given: 250
Re: Laser BASIC MEMORY &XXXX crash
« Reply #6 on: 16:15, 15 December 19 »
I have choosen HEXA  8)

I reach level 131 without ASM routine and then crash.

Got STRING garbage until &7000

Offline freemac

  • 464 Plus
  • *****
  • Posts: 326
  • Country: 00
  • Liked: 253
  • Likes Given: 250
Re: Laser BASIC MEMORY &XXXX crash
« Reply #7 on: 16:40, 15 December 19 »
If I remove the "SCORE:" :
Quote
280 '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 :
Quote
281 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)
« Last Edit: 17:13, 15 December 19 by freemac »

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.974
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 891
  • Likes Given: 2222
Re: Laser BASIC MEMORY &XXXX crash
« Reply #8 on: 17:13, 15 December 19 »
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 (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)