pete-gordon / oricutron

Portable Oric-1/Atmos/Telestrat and Pravetz 8D emulator
http://www.petergordon.org.uk/oricutron/
GNU General Public License v2.0
69 stars 25 forks source link

CRASH WHEN LOAD ASM FROM BASIC WITH DATA #151

Closed David2604 closed 4 years ago

David2604 commented 4 years ago

hello ! if i do that = no crash ....

20 ADRESSE=1024 30 READ COD$ 40 REPEAT 50 FOR I=1 TO LEN(COD$) STEP 2 60 OCT=VAL("#"+MID$(COD$,I,2)) 70 POKE ADRESSE,OCT 80 ADRESSE=ADRESSE+1 90 NEXT I 100 READ COD$ 110 UNTIL COD$="FIN" 120 DATA A9488DAABBA9458DABBBA94C8DACBBA94C8DADBB60, FIN

and if i do that then crash ... 20 ADRESSE=1024 30 READ COD$ 40 REPEAT 50 FOR I=1 TO LEN(COD$) STEP 2 60 OCT=VAL("#"+MID$(COD$,I,2)) 70 POKE ADRESSE,OCT 80 ADRESSE=ADRESSE+1 90 NEXT I 100 READ COD$ 110 UNTIL COD$="FIN" 120 DATA A9488DAABBA9458DABBB 130 DATA A94C8DACBBA94C8DADBB60, FIN

it works with MESS emulator. very strange no ?

iss000 commented 4 years ago

Your program works fine in Oructron!

Screenshot_20191130_233512

You can see the loaded assembler code in the debugger window and after CALL#400 (or CALL1024) it places letters 'HELL' in the first display row. The problem here is that probably you try to execute the BASIC code under Sedoric DOS, in this case the address space #400..#4FF (i.e. 1024...1024+255) is reserved and you should NOT use it.

One more thing: it's NOT very good idea to use long variable names, because Oric BASIC understands ONLY the first 2 characters or: ADRESSE, ADRES, ADRE, AD are exactly the same variable!

I recommend you for such questions to use Oric forums: http://forum.defence-force.org/ or http://forums.oric.org/ you will get answers faster and with more detailed explanations.

Attached is TAP file with your program - it works! testbas.tap.zip

David2604 commented 4 years ago

thank you for your reply. it works when i load your tape test but go on to crash when i do a copy/past from the windows text editor. I don't understand why ?

David2604 commented 4 years ago

im not under Sedoric dos, only with the basic oricutron version.

iss000 commented 4 years ago

Which version are you using? Attach a screenshot with Oricutron full window - it will help.

David2604 commented 4 years ago

oricutron X64 dev wip rev:5fd606b try also with oricutron 1.2 CRASH EDIT: FIX LINE 180 AND 190 "CD$"

  1. Type the program under Oricutron
  2. LList
  3. restart oricutron and copy/paste the program from printer_out.txt file. 4.CLS-RUN-CALL 1024
  4. CRASH
assinie commented 4 years ago

Your screenshot show a space character at the end of the line 100: 0510 34 20 DOP $20,X

I think you have a space character at the end of each line but the last one. It's ok most of the time but not with DATA.

You split the data string CD$ every 2 characters, but the string at line 200 is 21 characters long, so you put a _VAL(" ")__ which is $00 at address 1034.

You can see it If you enter "d 1024" in the _MONITOR) window (the BRK instruction at $040A): image

After the BRK $A9, is a JMP $AC8D. You can type bs $400 in the MONITOR window before executing the CALL 1024 and trace your program to see what happen.

David2604 commented 4 years ago

only 20 characters at line 200 ? i think it's a "copy/paste" bug because when i tape this program manualy , it's works. i will wait for a future fix... sorry for bad english , i'm french. bravo et merci de vos réponses, continuez à travailler sur ce fabuleux émulateur. Longue vie à l'Oric !

assinie commented 4 years ago

La longueur de 21 caractères dont je parle est celle de la chaine "A9488DAABBA9458DABBB ". Il y a un espace à la fin de la ligne, après le B. Tu as le même problème en tapant la ligne à la main et en ajoutant en espace à la fin de la ligne. Tu peux faire le test en ajoutant la ligne suivante:

145 V$ = "*"+MID$(CD$,I,2)+"*":PRINT V$

Tu verras une ligne avec un espace entre deux étoiles.

De même, si tu ajoutes un ou plusieurs espaces après le FIN à la ligne 210, tu auras une erreur à l'exécution tu programme BASIC parce que le test en ligne 190 ne sera jamais bon.

assinie commented 4 years ago

Si tu veux éviter ce genre de problème, tu peux mettre les chaines de data entre guillemets. De cette manière, si il y a un ou plusieurs espaces à la fin de la ligne il ne seront pas pris en compte par l'instruction READ CD$

David2604 commented 4 years ago

la technique des guillemets fonctionne bien même si j'ai "OUT OF DATA ERROR IN 180" Mais je ne comprends toujours pas pourquoi l'émulateur perçois un espace à la fin de la ligne. Si je retape manuellement la ligne alors tout est OK. Est-il possible de corriger cela ? Ce problème n'apparait pas sous MESS, mais cet emu est moins attrayant et beaucoup moins rapide en "copier/coller". Sans titre

assinie commented 4 years ago

Tu as une erreur OUT OF DATA ERROR parce que tu as mis , FF dans les guillemets. TOUT ce qui est entre 2 guillemets est vue comme une seule chaine. Ce qu'il faut faire, c'est:

200 DATA "A9488DAABBA9458DABBB"
210 DATA "A94C8DACBBA94C8DADBB60", "FF"

Pour l'espace en plus en fin de ligne, je ne sais pas d'où ça peut venir, je n'ai pas ce problème et je n'ai pas entendu dire que quelqu'un d'autre l'avait sur les différents OS.

Il faudrait poser la question sur l'un des 2 forums http://forums.oric.org/ (essentiellement en français) ou http://forum.defence-force.org (plutôt anglophone)