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


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

Re: BASIC Commands Broken After Running BIN Program

From Brian Patrie <bpatrie@bellsouth.spamisicky.net>
Newsgroups comp.sys.apple2.programmer
Subject Re: BASIC Commands Broken After Running BIN Program
Date 2019-01-27 21:41 -0600
Organization Aioe.org NNTP Server
Message-ID <q2ltl7$1pjv$1@gioia.aioe.org> (permalink)
References (5 earlier) <d99090c1-e050-44b6-b9c3-23d7fb25d985@googlegroups.com> <f2ad5668-e00e-4752-8f15-40f0cdf24a85@googlegroups.com> <60564c0d-c83c-4b1c-860b-3d4fc3aa13a5@googlegroups.com> <de80393e-a0a9-48ec-8ae4-e64aed3e7eea@googlegroups.com> <ed3714a6-3f61-441a-b2b2-fe08d09f554d@googlegroups.com>

Show all headers | View raw


On 27/01/2019 17.04, Bill Chatfield wrote:
> Thanks everyone for the great information. I have another related question. My "online" program (https://github.com/gungwald/online) is setup to load at $2000 and the type is SYS. But I am able to run it inside BASIC.SYSTEM, which should also be loaded at $2000. I didn't realize what I was doing when I set it up that way. But it doesn't seem to cause any corruption of the in memory BASIC.SYSTEM. How is this possible? Am I just getting lucky? 

BASIC.system doesn't stay at $2000; it relocates itself to the space 
below $BE00 ($BE00..BEFF being BASIC.system's globals page, and 
$BF00..BFFF being ProDOS' globals page.  It then allocates some buffers 
below itself.  All of this extends downward to near $A000 or 
$9000--which is why you got "NO BUFFERS AVAILABLE" when you tried to 
load there.  BASIC.system extensions (e.g. the ProCmd stuff) push this 
even lower; so you might want to load even lower than $8000.

$2000 is getting pretty low, and will step on the end of any BASIC 
programme over 6k.  It's also the start of the first hi-res graphics 
screen, which (not including the last screen hole) ends at $3FF8.  The 
second HGR screen ends at $5FF8.  So $4000 or $6000 is a pretty safe 
load addresse for a mid-sized chunk of transient code.  It largely 
depends upon what you want to avoid trashing.

Also note that the free space is used by BASIC for variables; but if 
your code is not meant to coexist with a /running/ BASIC programme, 
that's not an issue.

As for running SYS programmes from BASIC, this is a weird thing to do, 
and can become complicated.  You can do it, and RTS from them back to 
BASIC; but RTS is not a viable way to return from a SYS programme to the 
quit (BYE) handler.  So things meant to return to BASIC may as well be 
BIN programmes (which also allows you to choose where they load--whereas 
SYS files always load at $2000.

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


Thread

BASIC Commands Broken After Running BIN Program Bill Chatfield <billchatfield1@gmail.com> - 2019-01-25 21:01 -0800
  Re: BASIC Commands Broken After Running BIN Program kegs@provalid.com (Kent Dickey) - 2019-01-25 23:48 -0600
    Re: BASIC Commands Broken After Running BIN Program Antoine Vignau <antoine.vignau@laposte.net> - 2019-01-25 22:08 -0800
      Re: BASIC Commands Broken After Running BIN Program Bill Chatfield <billchatfield1@gmail.com> - 2019-01-25 23:04 -0800
        Re: BASIC Commands Broken After Running BIN Program Antoine Vignau <antoine.vignau@laposte.net> - 2019-01-25 23:31 -0800
    Re: BASIC Commands Broken After Running BIN Program Bill Chatfield <billchatfield1@gmail.com> - 2019-01-25 23:03 -0800
      Re: BASIC Commands Broken After Running BIN Program gids.rs@sasktel.net - 2019-01-26 09:33 -0800
        Re: BASIC Commands Broken After Running BIN Program Bill Chatfield <billchatfield1@gmail.com> - 2019-01-26 10:26 -0800
          Re: BASIC Commands Broken After Running BIN Program Marco Verpelli <mverpelli@libero.it> - 2019-01-26 10:52 -0800
          Re: BASIC Commands Broken After Running BIN Program gids.rs@sasktel.net - 2019-01-26 11:30 -0800
            Re: BASIC Commands Broken After Running BIN Program Antoine Vignau <antoine.vignau@laposte.net> - 2019-01-26 11:34 -0800
              Re: BASIC Commands Broken After Running BIN Program Bill Chatfield <billchatfield1@gmail.com> - 2019-01-26 13:46 -0800
                Re: BASIC Commands Broken After Running BIN Program gids.rs@sasktel.net - 2019-01-26 14:50 -0800
                Re: BASIC Commands Broken After Running BIN Program Bill Chatfield <billchatfield1@gmail.com> - 2019-01-27 15:04 -0800
                Re: BASIC Commands Broken After Running BIN Program gids.rs@sasktel.net - 2019-01-27 17:44 -0800
                Re: BASIC Commands Broken After Running BIN Program Brian Patrie <bpatrie@bellsouth.spamisicky.net> - 2019-01-27 21:41 -0600
                Re: BASIC Commands Broken After Running BIN Program Bill Chatfield <billchatfield1@gmail.com> - 2019-01-30 14:23 -0800
                Re: BASIC Commands Broken After Running BIN Program Michael Pohoreski <michael.pohoreski@gmail.com> - 2019-01-31 23:05 -0800
                Re: BASIC Commands Broken After Running BIN Program Brian Patrie <bpatrie@bellsouth.spamisicky.net> - 2019-02-02 13:15 -0600
              Re: BASIC Commands Broken After Running BIN Program Bill Chatfield <billchatfield1@gmail.com> - 2019-01-27 15:38 -0800
    Re: BASIC Commands Broken After Running BIN Program Brian Patrie <bpatrie@bellsouth.spamisicky.net> - 2019-01-26 14:04 -0600
  Re: BASIC Commands Broken After Running BIN Program Du Hast <duhast6377@gmail.com> - 2019-01-28 16:54 -0800

csiph-web