[comp.sys.apple] exec files

schlichting%v70nl.DECnet@NUSC.ARPA ("V70NL::SCHLICHTING") (09/14/87)

How do I "EXEC" files? I'm unfamiliar with this procedure. Thanks.
Christine Schlichting (Schlichting@NUSC.arpa - I don't know my address from
other nets).
------

patth@dasys1.UUCP (09/22/87)

In article <8709141017.aa01550@SMOKE.BRL.ARPA>, schlichting%v70nl.DECnet@NUSC.ARPA ("V70NL::SCHLICHTING") writes:
> How do I "EXEC" files? I'm unfamiliar with this procedure. Thanks.
> Christine Schlichting (Schlichting@NUSC.arpa - I don't know my address from
> other nets).
> ------
Downloaded from The Apple/Boston Connection BBS
(617) 275-9422 (300/1200 Baud, 24 hrs)

                           A PRIMER ON FILE TRANSFERS

                               by Dan Strassberg

          Whole books can be (and have been) written on the subject of
          microcomputer telecommunications.  It isn't possible to put
          a comprehensive treatise in a short article, but if you've
          been using your Apple for communicating with local bulletin
          board systems (BBS's) and haven't done much file downloading
          or uploading and want to get started, here are some of the
          basics you need to know.

          A. Filetypes and Operating Systems

          Most of the files you will be downloading will be of one of
          the following types:
               1. Textfiles containing documentation on how to use a
                  program.
               2. Textfiles which are EXECable listings of programs
                  written in BASIC
               3. Textfiles which represent the contents of a portion
                  of memory as hexadecimal ASCII characters (or more
                  correctly, MONITOR listings).  These usually
                  represent Machine Language programs (files that
                  appear in a DOS 3.3 Catalog as type "B" or a ProDOS
                  Catalog as type BIN) but can also represent graphic
                  images (HI-RES or LO-RES) or BASIC programs.  Like
                  the EXECable BASIC listings, these textfiles are
                  transferred to memory by use of the DOS (or ProDOS)
                  EXEC command.
               4. Tokenized BASIC files (in which all of the BASIC
                  language reserved words--e.g. PRINT and IF --are
                  converted to one byte "tokens".)
               5. Binary files
               6. Binary files representing "compacted" disks.  During
                  the actual file transfer process, these are the same
                  as type "5", but after a compacted file is on your
                  disk, in order to use it, you must de-compact it,
                  using a program like the one that compacted it in
                  the first place.  After the de-compaction process,
                  the result is a complete disk which may contain many
                  files.

          It is important to understand that the type of file
          described in "5" is different from that described in "3" and
          the type of file described in "4" is different from that
          described in "2", though the DOS EXEC command provides a
          means of transforming "2" to "4" or "3" to "5".

          B. ASCII vs. Protocol Transfers

          For downloading files you ought to have a telecommunications
          program which is capable of performing file transfers in
          several modes.  All types of textfiles (e.g. "1" through "4"
          above) may be downloaded using a mode called ASCII file
          transfer where the files are usually captured in a "buffer",
          an area in the Apple's RAM reserved for the purpose by the
          telecommunications program, and then written to disk when
          the buffer fills up or the file transfer is complete.  For
          downloading files of types "4" or "5" in the list above your
          program must support some means of "protocol transfer".
          This is because the ASCII code used to transfer text uses
          only seven bits, but a byte contains eight bits.  Even
          though you set up your terminal program for "8 data bits",
          when transferring text, the most significant bit of each
          byte is always set to a predetermined state.  The best known
          and most widely used microcomputer file transfer protocol is
          XMODEM, also sometimes referred to as the Christensen
          protocol, after its inventor, the legendary Ward
          Christensen.  Use of a file transfer protocol requires that
          both your computer and the BBS from which you are
          downloading use the same protocol.  Note that file transfer
          protocols may be used for transferring any type of file,
          including text, while ASCII transfer is usable only with
          text.

          C. The Four Apple // Operating Systems

          There are four operating systems in common use on the
          Apple // series today, the venerable but still viable DOS
          3.3, the newer ProDOS, Apple Pascal and the grandfather of
          all micrcomputer operating systems, CP/M-80.  Each has its
          own unique disk format.  There are file transfer utility
          programs which permit files to be moved among these
          operating systems, so if you have utilities which can move
          files between the operating system under which your terminal
          program runs and the one under which your downloaded program
          runs, in theory you don't need more than one terminal
          program.  In practice, however, it is much simpler to
          download a file onto a disk formatted for the operating
          system under which the downloaded file is intended to be
          used.  While there are a couple of terminal programs which
          are capable of reading, writing and sometimes even
          formatting diskettes for operating systems other than the
          one under which they run, each of these has significant
          drawbacks and probably shouldn't be considered seriously.
          In 1986, if you are doing much file transfer on an Apple,
          you really need a terminal program which runs under DOS 3.3
          and another which runs under ProDOS.

          D. Using Downloaded Files

          Once you have a file on disk, what do you do with it?  Files
          of type "1" should be loaded into a word processor which
          runs under the proper operating system and is capable of
          loading ASCII files.  (In AppleWorks, for example, you
          create a new word processor file from an ASCII file on
          disk.)  Files of type "2" should be EXECed into memory and
          then SAVEd.  Be sure to use a different name than that of
          the downloaded textfile.  For files of type "3", it will
          probably be necessary to first view the file with a word
          processor and determine the starting address and length.
          Then exit from the word processor and EXEC the file.  Since
          you know the starting address and have calculated the
          length, you may now BSAVE the file.

          If you encounter a large number of "SYNTAX ERROR" messages
          when you attempt to EXEC a downloaded file, inspect the text
          using a word processor capable of displaying embedded
          control characters.  You may find that each line begins with
          a linefeed (^J) character.  These sometimes appear because
          of the differences in the formatting conventions for
          textfiles in the different operating systems.  (For example,
          XMODEM was first designed to run under CP/M where the
          linefeed characters are needed.)  While many word
          processors, and the text editors which are part of many
          Apple terminal programs may be used for removing these
          characters, some terminal programs include utilities for
          stripping out or adding extra linefeeds.  The CHFORM utility
          found on the disk for ASCII Express, the Professional, (AE
          Pro) will do this.

          With many terminal programs, most notably AE Pro, which is
          far and away the most popular terminal program for the
          Apple, binary files (types "4" and "5" in the list above)
          present special problems.  If you have downloaded the file
          using XMODEM, unless you have downloded it from a BBS
          running AE Pro (or which supports transmission of binary
          file headers in the same manner as AE Pro) the file will be
          saved as a textfile, even though it should have been saved
          as a binary file.  To correct this, you need to modify the
          catalog listing of the file using a sector zap utility.  (A
          description of this process is beyond the scope of this
          article; in fact, I don't even know how to do it on a ProDOS
          disk.)  Terminal programs which allow you to specify that a
          file is binary before downloading it using XMODEM eliminate
          this problem.  Modem MGR, an excellent and reasonably priced
          new program is one such.  If you download a binary file
          intended to run under DOS 3.3 using a ProDOS based terminal
          program, and your program saves the binary file as text, be
          sure to correct the catalog entry BEFORE attempting to move
          the file to DOS 3.3.  If you don't heed this advice, the
          file will not make it into the other operating system in
          usable condition because the state of the most significant
          bit of every byte will not be preserved in the transfer!


-- 
Patt Haring                       UUCP:    ..cmcl2!phri!dasys1!patth
Big Electric Cat                  Compu$erve: 76566,2510
New York, NY, USA                 MCI Mail: 306-1255;  GEnie: PHaring
(212) 879-9031                    FidoNet Mail: 1:107/132 or 107/222