Auto GEM code generation from RSC in FORTH

GFA, ASM, STOS, ...
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 759
Joined: Wed Feb 01, 2012 9:34 pm

Re: Auto GEM code generation from RSC in FORTH

Post by Moulinaie »

ThorstenOtto wrote: Thu Jan 18, 2024 7:07 pm
It does not seem to be caused by autoexec.for. I get that message regardless whether the file exists or not.

Maybe try to run it in the same scenario in Hatari, and trace gemdos calls will help.

BTW, typing "exit" without anything on the stack gives a bus-error.
exit does not exit.
Well, actually yes, but within a word to come back to the parent word.
If you want to get out to the desktop, use "system".

Guillaume.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: Auto GEM code generation from RSC in FORTH

Post by ThorstenOtto »

Yeah, thats clear. But still it should not cause a bus-error ;)
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: Auto GEM code generation from RSC in FORTH

Post by ThorstenOtto »

The "bad Fopen" from Hatari is caused by an Fopen with an empty filename. Examining the memory from the logs above verifies that:

Code: Select all

> memdump 0x10E52CF
010E52CF: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
010E52DF: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: Auto GEM code generation from RSC in FORTH

Post by ThorstenOtto »

The error dialog disappears when i tell gemini *not* to use ARGV for GEM-Programs. ARGV means that the first byte in the commandline is 127. I think FORTH does not handle that, and tries to interpret the remaining commandline (which is normally empty, since the actual parameter are passed in the ARGV enviroment variable) as a filename.
User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 13541
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Auto GEM code generation from RSC in FORTH

Post by wongck »

ThorstenOtto wrote: Thu Jan 18, 2024 12:24 pm
What RSC editor did you use?
My own of course ;) (ORCS)
:lol: :lol: I was like... isn't it obvious??? His own, of course.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff that are no longer for sale due to them over 30 years old - click here for list
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 759
Joined: Wed Feb 01, 2012 9:34 pm

Re: Auto GEM code generation from RSC in FORTH

Post by Moulinaie »

ThorstenOtto wrote: Thu Jan 18, 2024 10:48 pm The error dialog disappears when i tell gemini *not* to use ARGV for GEM-Programs. ARGV means that the first byte in the commandline is 127. I think FORTH does not handle that, and tries to interpret the remaining commandline (which is normally empty, since the actual parameter are passed in the ARGV enviroment variable) as a filename.
Thanks a lot!
You're right I don't handle this. I will have to modify that.

Guillaume.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: Auto GEM code generation from RSC in FORTH

Post by ThorstenOtto »

If you are looking for assembler code to handle ARGV parsing, you can take a look at https://github.com/th-otto/MagicMac/blo ... /cstartv.s or the pcvstart.s source of Pure-C. Both versions construct an array of pointers to the arguments at the bottom of the heap.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 759
Joined: Wed Feb 01, 2012 9:34 pm

Re: Auto GEM code generation from RSC in FORTH

Post by Moulinaie »

ThorstenOtto wrote: Fri Jan 19, 2024 7:33 am If you are looking for assembler code to handle ARGV parsing, you can take a look at https://github.com/th-otto/MagicMac/blo ... /cstartv.s or the pcvstart.s source of Pure-C. Both versions construct an array of pointers to the arguments at the bottom of the heap.
Thanks!
I have made rapidly a partial support for it. Sometimes in the future I will implement it all.

I have uploaded the new version.
Guillaume
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 759
Joined: Wed Feb 01, 2012 9:34 pm

Re: Auto GEM code generation from RSC in FORTH

Post by Moulinaie »

ThorstenOtto wrote: Thu Jan 18, 2024 10:24 pm Yeah, thats clear. But still it should not cause a bus-error ;)
This is fixed too!

Guillaume;
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: Auto GEM code generation from RSC in FORTH

Post by ThorstenOtto »

Confirmed. Passing parameters works now, and the error dialog is gone. The bus-error is also gone.Thank you!

Just another thing i noticed: i think you should locate the forth.inf file with shel_find(). Otherwise, if you assign FORTH.PRG to eg. *.for, then start it by double-licking a file that is not located in its directory, and have set the desktop settings such that the default directory is "Window" (and not application), it won't be found. This happens both with Gemini and the standard desktop.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 759
Joined: Wed Feb 01, 2012 9:34 pm

Re: Auto GEM code generation from RSC in FORTH

Post by Moulinaie »

ThorstenOtto wrote: Sat Jan 20, 2024 7:58 am Confirmed. Passing parameters works now, and the error dialog is gone. The bus-error is also gone.Thank you!

Just another thing i noticed: i think you should locate the forth.inf file with shel_find(). Otherwise, if you assign FORTH.PRG to eg. *.for, then start it by double-licking a file that is not located in its directory, and have set the desktop settings such that the default directory is "Window" (and not application), it won't be found. This happens both with Gemini and the standard desktop.
That's clever!
I'll add it.

Have you noticed that with rsc2for, I have added a summary of the RSC file at the end of the source? You get all defined names with their type and, for some objects, with their flags. That's a reminder you can use to know who's who when modifying the text.

Guillaume.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 759
Joined: Wed Feb 01, 2012 9:34 pm

Re: Auto GEM code generation from RSC in FORTH

Post by Moulinaie »

Moulinaie wrote: Sat Jan 20, 2024 8:32 am
ThorstenOtto wrote: Sat Jan 20, 2024 7:58 am Confirmed. Passing parameters works now, and the error dialog is gone. The bus-error is also gone.Thank you!

Just another thing i noticed: i think you should locate the forth.inf file with shel_find(). Otherwise, if you assign FORTH.PRG to eg. *.for, then start it by double-licking a file that is not located in its directory, and have set the desktop settings such that the default directory is "Window" (and not application), it won't be found. This happens both with Gemini and the standard desktop.
That's clever!
I'll add it.

Have you noticed that with rsc2for, I have added a summary of the RSC file at the end of the source? You get all defined names with their type and, for some objects, with their flags. That's a reminder you can use to know who's who when modifying the text.

Guillaume.

EDIT: shel_find done !
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: Auto GEM code generation from RSC in FORTH

Post by ThorstenOtto »

That was fast ;) Yes, well done, seems to work.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 759
Joined: Wed Feb 01, 2012 9:34 pm

Re: Auto GEM code generation from RSC in FORTH

Post by Moulinaie »

ThorstenOtto wrote: Sat Jan 20, 2024 3:15 pm That was fast ;) Yes, well done, seems to work.
I did that for M_Player but never had the idea to transfer it to Forth...

Guillaume.
Post Reply

Return to “Coding”