POWR-DISK Owner's Manual Example 3: Determining offset of the program you can't relocate: Assume a program such as TMPC, a time management program, which loads at 51287. Since the Tandy 200's default value of MAXRAM is 61104, the offset needed by RELOC.BA to create a TMPC-compatible version of POWR-DISK, is 9817. Load RELOC.BA from the disk and run it. You will need about 3000 bytes free at run time. RELOC.BA asks the following questions: 1. What is the offset? Enter the value previously determined, 9817. 2. What name do you want for the relocated version? We suggest names such as PDTMPC.CO for a TMPC-compatible version, etc. Once you have relocated POWR-DISK, you can create a BASIC program to load in the relocated version, then run the other application program directly from disk. With such a BASIC program, you can run nearly any application conven- iently regardless of conflicts with the original version of POWR-DISK. Manual Page 23 -------------- Example 4: Relocating POWR-DISK for simultaneous use with FLOPPY.CO [Why would anyone WANT two DOS's in their machine, one of which is decidedly inferior (FLOPPY)? -- It was originally felt that you still needed FLOPPY.CO in order to format disks; but as shown above, disks can be formatted with a direct CALL to POWR-DISK routines. A second thought was that you needed to be able to use FLOPPY, in order to load POWR-DISK. While that may have been true to original users who had the system Utility Disk, it's not true for users who can download copies of the program from CompuServe's Model 100 Forum Library. Consequently, the below information on relocating POWR-DISK to operate below FLOPPY.CO is presented as a curiosity, and information of interest, but which will probably never be used. Once POWR-DISK is installed, the only valid reason to use FLOPPY.CO would be the use of its disk backup capability. - ed.] FLOPPY.CO, the access program supplied with the TDD, is still necessary, even with POWR-DISK, to format diskettes and make backup copies. However, the Tandy 200 version has a TOP address of 57500 and a presumed END at 61103, which would totally overwrite POWR-DISK. Further, there is no relocator for FLOPPY.CO. POWR-DISK can be relocated below FLOPPY. The necessary offset is 61104-57500, or 3604 bytes. When running RELO.BA, use an offset of 3604 and name the new version PD-FLP. [An already relocated version is available in the file PDSK09.200 -ed.] Then the following BASIC program, called FLOPPY.BA, can run FLOPPY directly off the disk without losing POWR-DISK functions: 10 CLEAR 0, 57500 : LOADM"PD-FLP.CO",F 20 LFILES OFF:RUNM"PD-FLP" 30 KILL"PD-FLP.CO":RUNM":FLOPPY" POWR-DISK Owner's Manual NOTE: FLOPPY.BA and RESTOR.BA are available on the Utility disk. [and in the files PDSK07.200 and PDSK13.200, respectively - ed.] You can use FLOPPY.BA any time you want to run FLOPPY.CO. However, since there is no copy of FLOPPY.CO on the POWR-DISK Utility disk, you must transfer FLOPPY.BA to another disk of your own that has a copy of FLOPPY.CO on it. The numbers in the disk files may differ from those given above, in which case THE DISK FILES ARE CORRECT. Once you are finished using a relocated POWR-DISK, you can free up the RAM space it occupies by running RESTOR.BA, which is the following BASIC program: Manual Page 24 -------------- 10 LOADM":POWR-D.CO",F 20 LFILES OFF:CLEAR 0,58960:RUNM"POWR-D" 30 KILL"POWR-D.CO":LFILES MENU To run RESTOR.BA without errors, there must be a copy of POWR-D.CO on the disk and none in RAM. It is a simple matter to set up a disk to run an application by providing it with the necessary copies of POWR-D.CO and relocated versions of POWR-DISK, along with the application. Manual Page 25 -------------- Appendix "A" The Tandy Portable Disk Drive Entire books could be written on the subject of disk drives, but this short appendix describes only a few matters of prudence and simple curiosity. The 3-1/2 inch Diskette Technology has advanced considerably in diskettes for personal computers. The diskettes used in the TDD have more potential storage capacity than 5-1/4 inch diskettes (which are still the standard for desktop personal computers), yet require less than half the [surface] area. A 3-1/2 inch diskette holds about 100 Kbytes of data when used in the TDD; other disk drives can squeeze as much as 720 Kbytes onto the same diskettes. [Actually, the diskette contains 79 sectors available to the user, each sector holding 1280 bytes. If each sector were filled to capacity, the diskette would store 101,120 bytes, or 98.75 Kbytes, given a "K" in computerese is 1024 bytes. - ed.] Further, the 3-1/2 inch diskette is a decided step forward in ruggedness and reliability. No part of the magnetic surface is exposed, as a spring-loaded metal cover conceals the "window" in the hard plastic case. Be warned however, that these diskettes are not hermetically sealed: avoid dust and dirt; do not leave diskettes scattered on a desktop under papers, etc.; and do not carry them in pockets of clothing that sheds (sports jackets, etc.), [or in hip pockets where they are subject to breakage.] The other constant enemy of diskette data are magnetic fields. The wordless warnings on diskette boxes show horseshoe magnets, "keep away from magnets"; but remember that loudspeakers, motors, telephones, and office paper-clip holders all contain magnets. You needn't be paranoid, but don't be careless, either. POWR-DISK Owner's Manual The Disk-Drive Hardware The TDD comprises two basic moving parts; the motor and the head. The motor keeps the diskette spinning at a constant rate. The head glides over the diskette to read and write the data. The head can be in one of 40 different positions, relative to the edge of the diskette; each of these 40 positions is called a "track". If you examine the magnetic surface of a used diskette, you may be able to distinguish the lines of the tracks from friction with the head. [Each "track" contains two "sectors". The "head" touches the top surface of the disk, on the side away from the round "hub" protruding from the center of the case, and can be seen by looking into the open disk access slot in the front of the drive, using a flashlight. - ed.] Manual Page 26 -------------- Diskettes must be "formatted" before the drive can successfully read or write data. Formatting uses up some of the diskette's storage ability for magnetic timing marks, so that the drive controller hardware can determine where on the track the head is, at any point. After formatting, there are 1280 bytes for data storage left on each sector of the diskette. (Other drives, with more storage capacity, simply squeeze more bytes into the same size track.) We recommend formatting an entire box of diskettes as soon as they are purchased, making them ready for immediate use, and leaving no question as to whether a diskette is ready to store new files. The TDD operating system It may surprise you that the TDD has software built into it - and contains both RAM and ROM hardware - in order to control the disk hardware. The TDD is known as an "intelligent" disk drive, since it decides on its own which tracks are available and which are already full; whether a file with a certain name exists on the disk, etc. Thus, the POWR-DISK software merely sends codes conforming to those rules which allow the computer and the drive to communicate. [The "DOS" is really a communications program, not a disk controlling, Disk Operating System - ed.] There are advantages and disadvantages to this arrangement. The principal advantage is that code in the computer requires less room. The principal disadvantage is that the disk drive is more or less limited by its internal operating system to what its designers originally intended for its end use. In this case, this limitation means that the files on the TDD must be primarily sequential, rather than random access. You cannot change the middle part of a file with sequential access without rewriting the entire file. [ed changes] There are several other interesting observations about the TDD operating system: - The TDD O/S uses a "directory" to keep track of files on a diskette. Every diskette has a directory, which resides on the outside track, and uses one "sector". Thus an "empty" diskette holds 79 accessible sectors (of 1280 bytes each, for a total of 101,120 bytes). POWR-DISK Owner's Manual - The directory cannot hold more than 40 names, limiting the diskette to 40 files maximum, regardless of individual file sizes. - [Each file is limited in size to 64K, the equivalent of 65536 bytes, or 52 sectors (26 tracks). - ed.] - Each file uses at least one sector, no matter how small the file may be. - The TDD does not create "empty" files, i.e., files of zero length. If you open a file for output and fail to write to it, it will not appear in the disk directory after closing it. - The TDD can only deal with one file at a time, whether for input or output. [So you cannot open one file for input and another for output, a common disk drive capability. - ed.] - TDD file names can be longer than six characters plus an extension. The actual limit appears to be something more like 15 characters, which can also include lower case letters. However, POWR-DISK limits names to six characters for compatibility with FLOPPY.CO [and the computer's operating system.] Manual Page 28 -------------- Appendix "B" Machine Language Files in Tandy Laptops Tandy laptop users are faced with two choices: either accept mediocre perform- ance, or learn how to best use their machine's limited resources. Most users don't get far without having to learn some basic facts about how the Model 100 or Tandy 200 manages the scarcest resource, RAM space. RAM Organization The Model 100/200's memory is divided into a number of "bytes". You can think of a byte as a single character. Each byte holds a value from 0 to 255. The number of bytes depends on the machine and amount of memory; if there is more than one bank of RAM, the banks are almost completely independent. Each byte within a bank has a unique address, which is a number between 32768 and 65535. Depending on the amount of RAM installed, and the machine, not all the addresses are capable of "remembering" data (the bytes) stored to them. In the 200, some of these addresses are part of the ROM. (Read-Only Memory) However, the 8192 addresses from 57344 to 65535 are always valid RAM addresses in either machine. A good number of the top portion (3K for the 100, about 5K for the 200) are reserved as a "scratch pad" area for the ROM, and are called "Reserved System Memory". The file names that appear on the main menu, as well as numerous other bits of data, are stored in this area. The remainder of RAM is available for user data: BASIC programs, .CO programs, DOcument files, variable storage, etc. BASIC can tell you the lowest address of the reserved system memory; the value of MAXRAM returns that address.