home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.atari.8bit
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!news.belwue.de!ifi!straif
- From: straif@minnie.informatik.uni-stuttgart.de (Peter Straif)
- Subject: Re: File Headers.
- Message-ID: <1993Jan22.115353.29144@ifi.informatik.uni-stuttgart.de>
- Sender: news@informatik.uni-stuttgart.de
- Organization: Informatik, Uni Stuttgart, Germany
- References: <1jjps0INNek1@nz12.rz.uni-karlsruhe.de> <C16AKJ.3CI@mentor.cc.purdue.edu>
- Date: Fri, 22 Jan 1993 11:53:53 GMT
- Lines: 66
-
- In <C16AKJ.3CI@mentor.cc.purdue.edu> smb@pern.cc.purdue.edu (Scott M. Ballew) writes:
-
- >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
-
-
- Ok, $02E0 - $02E1 is the run address,
- $02E2 - $02E3 is the init address.
-
- I'm have an addition to: There is one problem, that occurs, when you
- use any SIO-handler (like P:) in an Init-Part:
- All IOCB-Blocks are copied into the zero page, when an operation
- is done on any channel.Normally, this doesn't matter, because
- on every SIO/CIO call this is done. But when you do it in the init part
- of a COM-File and then return to DOS ( with RTS ) , sometimes
- something strange can happen. For instance, I've programmed
- one time an Init-Part that sended a text to the printer ( p:),
- and after the RTS, Dos continued to load, but the floppy didn't
- READ from the file, but WROTE to it, because I've opened before
- an IOCB to the Printer with open #x,8,0,"P:". The only solution
- I saw, was to save the zero page IOCB before outputting to the
- printer, and afterwards to restore it.
- The same thing can happen, if you use handler-routines in the VBI
- ( for instance a T:-handler to get the current time from an
- real time clock).
-
-
- Peter
-
- ---------------------------------------------------------
- E-Mail: straif@minnie.informatik.uni-stuttgart.de
-
-
-
-