Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news1.as3257.net!newsfeed.tiscali.ch!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: ol.sc@web.de (Oliver Schmidt) Newsgroups: comp.sys.apple2.programmer Subject: Re: Good way to detect the current environment within ProDOS - launcher or BASIC? Date: Sat, 03 Aug 2013 10:12:21 GMT Organization: 1&1 Internet AG Lines: 20 Message-ID: References: NNTP-Posting-Host: p57905cbe.dip0.t-ipconnect.de X-Trace: online.de 1375524728 31593 87.144.92.190 (3 Aug 2013 10:12:08 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Sat, 3 Aug 2013 10:12:08 +0000 (UTC) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: csiph.com comp.sys.apple2.programmer:784 Hi David, >I'd like to tell the current ProDOS environment underneath my program. >I want to quit differently depending on being launched from BASIC (just >RTS) or from the program launcher (ProDOS QUIT MLI call). I didn't follow the reset vector approach pointed out by others. Instead I look at the ProDOS system bit map: https://github.com/oliverschmidt/cc65/blob/master/libsrc/apple2/crt0.s Lines 143 to 146: ; Check ProDOS system bit map lda $BF6F ; Protection for pages $B8 - $BF cmp #%00000001 ; Exactly system global page is protected bne basic Regards, Oliver