Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!sdcrdcf!trwrb!cadovax!gryphon!ddsw1!karl From: karl@ddsw1.UUCP Newsgroups: comp.sys.tandy Subject: Re: DOS WARS (Re: Ldos vs. NeWDOS) Message-ID: <335@ddsw1.UUCP> Date: Fri, 11-Sep-87 18:50:56 EDT Article-I.D.: ddsw1.335 Posted: Fri Sep 11 18:50:56 1987 Date-Received: Sun, 13-Sep-87 07:20:56 EDT References: <52@nancy.UUCP> <18@umn-d-ub.D.UMN.EDU> Reply-To: karl@ddsw1.UUCP (Karl Denninger) Distribution: world Organization: Macro Computer Solutions Inc., Mundelein IL Lines: 46 Keywords: Steven Speilberg In article <7118@reed.UUCP> trost@reed.UUCP (Bill Trost) writes: >In article <1123@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes: >% serious design flaw. They both want programs to load at a specific >% address. >I think that your understanding of TRSDOS is less than you suspect. >Not only will it allow you to load a program into memory anywhere >above the overlay area, but it will allow you to load different pieces >into different chunks of memory, a process known as scatter loading. >This allows you to some really neat and nifty things, like loading >drivers into high memory or even loading into screen memory instead of >having to draw an opening string. Yes, it will load the code ANYWHERE (and I do mean literally Anywhere, including attempting to load into ROM on a Model III -- although this will produce an error message because the loader can't write to ROM!) It will also happily load a program on top of a protected high memory region, destroying whatever might be there (and probably crashing your system as well). Now *that* is a serious problem -- especially if you keep drivers and other nifty stuff in the top of RAM, as I do (prime example: ERACS, our host/bbs system). There is literally no test for a proper (unused) load address, and no guarantee that you're in a 'safe' place.... Anyone (and I do mean ANYONE) who uses 'scatter loading' to load device drivers and such in high memory deserves slow execution -- these will fail EVERY TIME on a system which contains anything in high memory. The correct technique is to load in a non-scatter mode, then relocate your code to the *correct* place in memory. Oh, wait! I see the man in the back who says you can't write relocatable Z-80 code.... Baloney - at least on a Tandy I, III or IV! All three of them have a system call which is named "@Where". This system call returns the current physical address in (HL). Now, using this, and only a little black magic, it is quite possible to write relocatable long jumps and even CALL instructions! If your code is written in this manner it will execute properly at *any* legit physical memory address. -- Karl Denninger UUCP : ...ihnp4!ddsw1!karl Macro Computer Solutions Dial : +1 (312) 566-8909 (300-1200) "Quality solutions at a fair price" Voice: +1 (312) 566-8910 (24 hrs)