home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / atari / 8bit / 5924 next >
Encoding:
Text File  |  1993-01-21  |  2.0 KB  |  47 lines

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