Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #1608

Re: test for presence of BASIC.SYSTEM

Newsgroups comp.sys.apple2.programmer
Date 2015-04-19 11:53 -0700
References <10257333-0545-4358-9e51-770ba945208b@googlegroups.com>
Message-ID <b36c5c08-e3a8-46ce-a4c8-50fe10745751@googlegroups.com> (permalink)
Subject Re: test for presence of BASIC.SYSTEM
From gids.rs@sasktel.net

Show all headers | View raw


On Sunday, April 19, 2015 at 11:18:52 AM UTC-6, ivanx%i...@gtempaccount.com wrote:
> Assuming ProDOS 8 itself is booted, Is there a canonical way of determining from machine language whether BASIC.SYSTEM is running or not? I figured one way would be by looking at $0036/37, but I was wondering if there's something less ad-hoc.


There really is no sure fire way to tell if Basic.system is running or not, since Basic.system can be installed, then another system program is run which will disable Basic.system, but many of the addresses that Basic.system holds specific values will still be there.

Some of the more common addresses that is most often used when Basic.system is in effect are:

$3D0 which holds a JMP to $BE00, an entry point for Basic.system.  But this often does not gets changed if another system file is launched.  So only indicates that Basic.system was engaged at one point.  Same goes for a number of other addresses.

Zero page $73.74 - holds himem ($9600)- but still may hold the same value if another system file is launched.

even Prodos's page protect from $BF58 - BF6F, is no guarantee, since many system files do not zero out this area to signify those pages that were used by BS are free.

But I would say the best way of determining Basic.system is in effect is to check the Status Reg.

Putting this little machine code in a popular memory area:

300:BA 86 06 60

300:TSX
301:STX $06
303:RTS


produces the following results:

when a CALL 768 is executed from applesoft & BS is in effect then the stack holds $F6
when a 300G is executed from the monitor & BS is in effect then the stack holds $E0
when a JMP $300 is executed from a ML program and BS is not in effect, then it should hold the value that boot-up sets which is $FB



Would you mind sharing in what instance you would need to check for Basic.system, since many System files disable BS before launching and the Prodos page protect area ($BF58-BF6F) are usually zeroed out.

Rob

Back to comp.sys.apple2.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

test for presence of BASIC.SYSTEM ivanx%ivanx.com@gtempaccount.com - 2015-04-19 10:18 -0700
  Re: test for presence of BASIC.SYSTEM gids.rs@sasktel.net - 2015-04-19 11:53 -0700
    Re: test for presence of BASIC.SYSTEM gids.rs@sasktel.net - 2015-04-19 12:10 -0700
      Re: test for presence of BASIC.SYSTEM ivanx%ivanx.com@gtempaccount.com - 2015-04-19 15:12 -0700
        Re: test for presence of BASIC.SYSTEM gids.rs@sasktel.net - 2015-04-19 21:46 -0700
  Re: test for presence of BASIC.SYSTEM David Schmidt <schmidtd@my-deja.com> - 2015-04-19 18:55 -0400
    Re: test for presence of BASIC.SYSTEM ivanx%ivanx.com@gtempaccount.com - 2015-04-19 20:00 -0700
      Re: test for presence of BASIC.SYSTEM David Schmidt <schmidtd@my-deja.com> - 2015-04-20 07:34 -0400
  Re: test for presence of BASIC.SYSTEM ol.sc@web.de (Oliver Schmidt) - 2015-04-24 15:41 +0000

csiph-web