home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.atari.8bit
- Path: sparky!uunet!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pern.cc.purdue.edu!smb
- From: smb@pern.cc.purdue.edu (Scott M. Ballew)
- Subject: Re: File Headers.
- Message-ID: <C16AKJ.3CI@mentor.cc.purdue.edu>
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Organization: Purdue University
- References: <1jjps0INNek1@nz12.rz.uni-karlsruhe.de>
- Distribution: net
- Date: Wed, 20 Jan 1993 22:02:43 GMT
- Lines: 34
-
- In article <1jjps0INNek1@nz12.rz.uni-karlsruhe.de> UJ1G@DKAUNI2.BITNET (Marek Tomczyk) writes:
- >> What determines if it runs or returns to DOS?
- >
- >In order to automatically run a program you should specify a
- >starting address. This starting address is stored into the
- >memory locations $02E0-$02E1. An initiation address should be
- >written into $02E2-$02E3 (it could be vice versa, I don't have my
- >notes with me).
- >
- > ...
- >
- >> If you chain (by appending) files together, Which one gets control?
- >
- >Very simple, that one whose address is stored in the $02E0 vector.
- >You could specify an init address somewhere in the middle of the
- >chained file. Then DOS jumps to this routine. In order to continue
- >loading you have to exit your init routine with an RTS instruction.
-
- You missed a very important subtlety in this system. First, there
- is a difference between the RUN address and the INIT address (and I,
- too, cannot remember which is at $2E0-2E1 vs $2E2-2E3). When DOS
- loads the INIT address, it does a jsr to that address _immediately_
- (without continuing the load). When that code does and rts to DOS,
- DOS picks up with the load where it left off. This means that you can
- have multiple INIT addresses strewn through your load file and they
- are treated like subroutines to the load process (be sure the code
- they run has already been loaded, though :-). In the case of the RUN
- address, only the last value stored here matters. This is the one
- that DOS jsr's to _after_ the load is complete.
-
- Now, can someone with a memory map handy verify which address is
- which? I'm not sure where my memory map is.
-
- Scott
-