Subject: Re: [TI994A] Re: DM2K et. al.[

From: "Paolo Bagnaresi" <[email-masked]>
Date: Sat, 26 Dec 2009 10:27:07 +0100

Arrgh,

my memory is failing me.

The value to put in >8380 is not >0024, but >0020, as from E/A manual, 
page 252: Execute Power-Up Routine.

Paolo Bagnaresi

----- Original Message ----- 
From: "Paolo Bagnaresi" <[email-masked]>
To: <[email-masked]>
Sent: Saturday, December 26, 2009 10:13 AM
Subject: Re: [TI994A] Re: DM2K et. al.[

> Hi Fred,
> what if the user's program exits with a
> LWPI >83E0
> B    @>0070
>
> or
>
> LWPI >83E0
> B    @>006A
>
> ?
>
> Then the >0024 you store in R11 of GPLWS will simply be ignored. To 
> avoid this problem you should work with the GPL return stack too. If you 
> want to force a Master Title Screen when the user's program exits, you 
> have to load >80 in the >8373 byte in the Scratch Pad and store >0024 in 
>  >8380. That is before letting the user's program run.
>
> If the user exits with a
> LWPI >83E0
> B    @>0070 (or >006A)
>
> the GPL interpreter will find that the next GPL routine to be executed 
> is the one at >0024 (in Grom 0), which is exactly what you want: the 
> Master Title Screen.
>
> A caveat: by placing >80 in >8373 you will also destroy any valid GPL 
> return address that might exist in the GPL Return Stack that starts at
> >8380. So, do that only if you want to force a reset onto the user.
>
> A note: I seem unable to locate my TI-Intern copy (by Heiner Martin). I 
> am not really sure about the right value you have to put in >8373. As I 
> said above, I think it is >80, but if >80 does not work, try >82. The 
> point is, I don't remember if the value in >8373 is the pointer to the 
> First Free in the GPL Return Stack or the pointer to the Last Used in 
> the GPL Return Stack.
>
> Have fun,
>
> Paolo Bagnaresi
>
>
>
>
>
> ----- Original Message ----- 
> From: "fredkaal"
> To: <[email-masked]>
> Sent: Friday, December 25, 2009 12:11 PM
> Subject: [TI994A] Re: DM2K et. al.[
>
>
> About the graceful exit:
>
> This problem also occured in v1.0 ..v1.7 and was fixed in v1.8 by adding
> LWPI >83E0
> LI     R11,>0024
> at the start of the program.
>
> What this does is using the GPLWS and set address >0024 as the return 
> address of the program. When the program returns it returns at the start 
> of the GPL interpreter. Maybe this isn't a good choice when using 
> funnelweb. It is also unsure if some register are still at the right 
> value. Maybe it is better to always exit to the reset vector at >0000 or 
> first save the whole GPL workspace and restore it later.
>
> Anybody have some ideas about this matter?
>
>
>
> Dm2k from V1.9 up is using more CPU and VDP ram and maybe overwrites 
> something that funnelweb tries to preserve.
>
> Fred ;-)
>
>
> --- In [email-masked], rmcarmany@... wrote:
>>
>> This is probably a problem unique to my particular system so let me 
>> explain
>>  what I have installed:
>>
>> A HSGPL-modified console
>> A P-Box with:
>>
>> AVPC Card
>> HSGPL Card
>> RS232 Card
>> HRD16 3 Meg Ramdisk
>> BWG Disk Controller
>> Myarc HDFC (modified to act only as a hard drive  controller)
>> SAMS Card (1 meg)
>>
>> The operating system is the HSGPL BOOT program with F'WEB as my primary
>> operating system with RXB as my default XB.
>>
>> I have a couple of 3.5" floppy drives and two 20 meg hard drives 
>> attached
>> as well as two printers and a modem.
>>
>> The problem that I have is that I have never been able to  successfully 
>> run
>> DM2K in any version from 2.0 up. Vn 1.9 runs great and I can  copy, 
>> delete,
>> etc. files from anywhere to any destination in the system. Any  version
>> above Vn 1.9 doesn't work correctly. When I try to use the "Copy file"
>> operative, for example, nothing appears next to the filename in the 
>> directory of
>> the later versions and that is as far as I can go.  In addition, 
>> neither
>> DM2K (Vn 2.0-2.4) or DU Vn 2.0) exit gracefully when "Q" is  pressed - 
>> I
>> simply get a blue screen and apparent lockup. I get identical  results 
>> whether I
>> load DM2K from F'WEB, the RXB E/A cartridge, or a regular,  stock E/A
>> cartridge. It also doesn't matter whether I load DM2K from a  RAMdisk, 
>> physical
>> floppy, or a Hard Drive. The results are always the same.  Anyone else 
>> have
>> problems running the more recent versions of DM2K on an  80-column 
>> system? Any
>> assistance would be greatly appreciated.
>>
>>
>> Bob  Carmany
>>
>
>
>

---

From: mark wills <[email-masked]>
Date: Sat, 26 Dec 2009 02:28:12 -0800 (PST)

IIRC I just do a BLWP @0 

Seems to work every time...

Mark

>
>From: Paolo Bagnaresi <[email-masked]>
>To: [email-masked]
>Sent: Sat, 26 December, 2009 9:27:07
>>From: "Paolo Bagnaresi" <paul.bagnaresi@ gmail.com>
>>To: <TI994A@yahoogroups. com>
>>> To: <TI994A@yahoogroups. com>
>>> --- In TI994A@yahoogroups. com, rmcarmany@.. . wrote:
>>>>

---

From: "Paolo Bagnaresi" <[email-masked]>
Date: Sat, 26 Dec 2009 13:23:07 +0100

Mark, it works fine every time if you exit *your own program* that way.

Things change if you run an external program and the final exit will be 
taken by that external program. Some programs try to return to the GPL 
Interpreter, because the program takes for granted it was launched by a 
module (usually from E/A Opt.5).
Thus, they exit this way:

LWPI >83E0
B      @>0070

The best approach for these program is to prepare a Master Title Screen in 
the GPL Substack.

Paolo

 ----- Original Message ----- 
From: "mark wills" <[email-masked]>
To: <[email-masked]>
Sent: Saturday, December 26, 2009 11:28 AM
Subject: Re: [TI994A] Re: DM2K et. al.[

IIRC I just do a BLWP @0

Mark

---

From: "fredkaal" <[email-masked]>
Date: Sat, 26 Dec 2009 13:01:24 -0000

Examining TI-intern I found that branching to the reset vector witch is:
>0000 DATA >83E0
>0002 DATA >0024

with BLWP @>0 does the same thing as:
LWPI >83E0
LI  R11,>0024
BL  @START

in the hope that the user program will return somewhere with:
B *R11

It is allowed for the user program to ignore this and do its own return scheme like:
BLWP @>0

or 
LWPI >83E0
B @>0024

etc.

What will fail is:
LWPI >83E0
B @>0070

if some registers are not setup correctly as expected by the GPL interpreter.

For now I believe that the returning scheme of Dm2k, Cf2k and Du2k are OK but you can't guarantee that a program started with Dm2k or Cf2k will also exit gracefully if it expects to return to i.e. the editor/assembler module like Paolo said.

Fred ;-)

--- In [email-masked], mark wills <markrobertwills@...> wrote:
> >From: Paolo Bagnaresi <paul.bagnaresi@...>
> >>> --- In TI994A@yahoogroups. com, rmcarmany@ . wrote:
> >>>>