home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / PGMUTL / OBRONM11.ZIP / README < prev    next >
Encoding:
Text File  |  1991-02-24  |  17.3 KB  |  456 lines

  1.  
  2. Oberon-M(tm) version 1.1 for MSDOS
  3.   (c) Copyright E. R. Videki 1989-1991
  4.   All Rights Reserved (see Legal Notice below)
  5.   
  6. This is the information file for version 1.1 of Oberon-M,
  7. an implementation of the Oberon programming language 
  8. suitable for MSDOS environments running on Intel-compatible
  9. processors of 80186 or later vintage.
  10.  
  11.  
  12. LEGAL NOTICE
  13.   Oberon-M is a trademarked and copyrighted product.  Use
  14.   of the compiler and sample library modules is granted
  15.   by license, with no charge for this release.  
  16.   However, the compiler and the source texts associated 
  17.   with it may not be sold, modified, or distributed for 
  18.   gain in any way.  There are two exceptions:
  19.       1) The library modules may be modified by the end
  20.          user for his or her own programming needs
  21.       2) Networks and electronic bulletin boards may be
  22.          used to freely redistribute this Oberon-M 
  23.          package as a COMPLETE UNIT.
  24.          
  25.   All programs produced using this package are under the
  26.   ownership, control and responsibility of the end user.  
  27.   
  28.   The compiler may never be modified and its copyright notice
  29.   must remain intact.  If any of the library modules or
  30.   examples are used in printed matter, their copyright
  31.   notices must also remain intact, and credit by 
  32.   reference given to the Oberon-M author.
  33.   
  34.   No warranties or claims of fitness for use are made for
  35.   any item within this package.  All responsibilites for
  36.   use and outcome rest with the end-user.
  37.   
  38.  
  39.  
  40.  
  41. BACKGROUND
  42.  
  43.   The Oberon-M compiler is an MSDOS based program which
  44.   translates Oberon source code files into MSDOS object
  45.   files.  These files are linked together to form 
  46.   executable programs (files of ".EXE" type).
  47.   
  48.   Oberon was invented by Niklaus Wirth at the Swiss
  49.   Federal Institute of Technology (ETH) in Zurich.  Like
  50.   his earlier languages Pascal and Modula-2, Oberon is
  51.   intended for general purpose programming, often on
  52.   individual workstations.  Most, if not all, of the
  53.   clumsiness that many people found in Pascal and Modula-2
  54.   is not present in Oberon.  The general philosophy of
  55.   its construction is to keep important principles of the
  56.   computing environment present for the programmer to 
  57.   take advantage of, while providing a structural- and
  58.   checking-mechanism that prevents inadvertent (even
  59.   disasterous) mistakes.  Software development is some
  60.   of the most complex, detail-filled work performed by
  61.   the human race to date. Oberon is a tool by which the
  62.   power of the computer can be handled without the 
  63.   bounds of human capability being taxed.  Thus, Oberon
  64.   provides well-defined boundaries for modules, into
  65.   which complex computing tasks may be divided.  
  66.   
  67.   Additionally, Oberon provides a new facility, called
  68.   "type extension", which permits an existing application
  69.   to have new features and power added to it-- without
  70.   the old source code even having to be recompiled.  Data
  71.   types ("records") may be extended by new data, with 
  72.   additional handling routines implemented in new code.
  73.   The old source can still work with these new, extended,
  74.   data types, handling the older fields and operations
  75.   applicable to them, without knowing (or caring) that
  76.   new extended fields and operations are also present.
  77.   
  78.   Object oriented facilities are also present in Oberon. 
  79.   Data records may contain "methods" associated with them
  80.   so that the actual handling of information can be
  81.   linked directly with the object (record) itself.  
  82.   Operations can be directed at the records themselves. When
  83.   new facilities are needed, new methods can be invoked
  84.   ahead of the existing operations performed by (or,
  85.   some say, on behalf of) the object.  An application
  86.   may be written in Oberon to either look at data as it
  87.   relates to executable algorithms, or to look at the
  88.   algorithms as adjuncts to the data items themselves.
  89.   
  90.   Additionally, references to items outside of a source
  91.   module are clearly made so that a human being can, just
  92.   by examining the source file, know exactly what imported
  93.   module's facility is being used for what.  In general,
  94.   most Oberon programs can afford to be relatively short,
  95.   and few people ever need the aid of source-cross-reference
  96.   tools to figure out what's going on.
  97.   
  98.   When a module is written, an indicator following an object's
  99.   name (an asterisk) tells the compiler that that object
  100.   is visible to other modules.  Objects that are not
  101.   exported in this fashion remain hidden to clients of the
  102.   module.  A very effective hierarchy of abstraction can
  103.   be thus established for very complicated computing tasks.
  104.   Many programmers will agree that the ability to look at
  105.   or modify items in another module, when those items were
  106.   not intended to be "proper" and "defined" for external use,
  107.   usually ends up causing debugging problems that are
  108.   difficult or impossible to trace when the application is
  109.   in use.  A compiler's job, in the Oberon philosophy, is to
  110.   put the power of the machine in the programmer's hands, not
  111.   hiding when things can be more efficiently done by source
  112.   changes (versus compiler built-in decisions for a particular
  113.   code sequence), while still stopping accidental changes to
  114.   another module.
  115.   
  116.   Many of the items which, over the years, have been
  117.   added to programming languages have been removed from Oberon.
  118.   Although we all have our favorite language construct, and
  119.   may complain when we don't find it in Oberon (even if it was
  120.   present in Pascal or Modula), most people quickly decide
  121.   they still prefer the clean, simpler approach to programming offered
  122.   by Oberon.  Several years of very careful examination and
  123.   thought passed before items were removed from Pascal-Modula
  124.   to make Oberon.  Very little needed to be added to that result
  125.   to gain type extension and Object Oriented facilities.
  126.   
  127.   
  128.   
  129.  
  130. COMPILER
  131.  
  132.  
  133. The compiler itself is called "oc.exe".  It is run with the
  134. following command line under MSDOS:
  135.  
  136.         oc  filename[.mod]  [def]
  137.  
  138. If the optional ".mod" is ommitted, the compiler will append
  139. it to the file name.
  140.  
  141. The "def" option, specified just as shown, will cause a
  142. module which exports items to have a special symbol file
  143. written to disk.  Unless this symbol file exists, other
  144. modules cannot import this module.
  145.  
  146. "def" is also a safety feature: modules are checked at compile 
  147. and run time for consistency of level of object form
  148. with the form used for compilation.  Only when you specify
  149. the "def" option after the file name will the symbol file
  150. used when compiling other modules which import this one
  151. be (re-)written on the disk.
  152.  
  153. If you are writing a module that is imported by others, 
  154. when you want its symbol file to be (re-)written (and 
  155. used by other compiliations), you MUST specify
  156. "def" on the command line of the module that is to be
  157. imported.  You do not use "def" when a module exports
  158. nothing (such as your "main" module).
  159.  
  160. The compiler generates standard MSDOS object files which
  161. ultimately must be linked with the other object files
  162. representing imported Oberon modules, plus
  163. linked with the special run-time support file SYS.OBJ .
  164.  
  165.  
  166.  
  167. LINKING OBJECT FILES
  168.  
  169. An MSDOS linker or its equivalent will bind together
  170. the object files.  There are two rules that must be followed.
  171.  
  172.         1) Your "main" module (the one that is to receive
  173.            control from DOS after all other modules are
  174.            initialized, and which is not imported by any
  175.            other module) must be named FIRST in the list
  176.            of modules to link together.
  177.  
  178.         2) The small run-time support object file, named
  179.            SYS.OBJ must be named LAST in the list of modules
  180.            to link together.
  181.  
  182. An example of use:
  183.  
  184.         link  mymain+import1+import2+sys ;
  185.  
  186. ...will generate a file named "mymain.exe" which is
  187. executable (assuming your programming is correct!).
  188.  
  189.  
  190.  
  191. OTHER FILES SUPPLIED IN THIS PACKAGE
  192.  
  193.  
  194. The compiler is supplied with a number of additional files
  195. in this package.
  196.  
  197.  
  198.  
  199. Oberon Language Documentation:
  200.  
  201. obrept.ps       - Niklaus Wirth's definition of the Oberon
  202.                         language, which is supported by
  203.                         this Oberon-M(tm) compiler.
  204. obebnf.ps       - The EBNF summary of the language
  205.  
  206. *** Note: these files must be downloaded to a
  207. PostScript(tm) processing printer for correct formatting! ***
  208.  
  209.  
  210.  
  211. Oberon Modules for use under MSDOS
  212.  
  213. These are modules which work under most (if not all) versions
  214. of MSDOS, and which you may import into your own
  215. programs.  They are provided in source form, as well
  216. as "ready to link" form, plus pre-compiled symbol forms
  217. so that you do not have to compile them before importing
  218. them.
  219.  
  220. They include:
  221.  
  222.         Disk    Disk file direct-handling
  223.         IO      General I/O operations
  224.         LineIO  Specific line-oriented file I/O
  225.         LIO     A version of LineIO with indentation
  226.         Screen  Direct-writing to many display screen types
  227.         Parms   Reading parameters from the MSDOS command line
  228.         Term    I/O specifically for keyboard and display
  229.  
  230.  
  231.  
  232. Example Modules
  233.  
  234. Two examples are provided, both of which are examples of
  235. working Oberon programs.  The first, called Abu, is a
  236. fast full-screen file browser.  The second, called OE,
  237. is a very robust set of modules that creates a name and
  238. telephone number reference table, and shows Oberon's
  239. type extension and Object Oriented Programming features.
  240.  
  241.  
  242. *Abu*
  243.  
  244. The module Abu.mod is a full-featured example of using
  245. the Oberon-M compiler with many of the supplied modules
  246. to make a simple fast-executing, very small, full-screen
  247. file browser.  (Note: Since this module uses the Screen.Mod
  248. module which may be incompatible with some types of display
  249. screens, you may have to modify Screen for your machine
  250. before Abu.mod works.)
  251.  
  252. If you want to execute this example before fiddling with
  253. the source, simply type:
  254.  
  255.         abu  <filename>
  256.  
  257. and the Abu.exe file will let you browse the file you named.
  258. NOTE: you MUST put a filename on the command line, else
  259. Abu ends immediately.
  260.  
  261.  
  262.  
  263. *OE*
  264.  
  265. The OE modules (OE.mod, OETree.mod, OENames.mod, OEPhone.mod,
  266. and OEIO.mod) are documented in a separate file called
  267. README.OE, supplied in this package.
  268.  
  269.  
  270.  
  271.  
  272.  
  273. Utility Module
  274.  
  275. The executable file "xdef.exe" is a utility program that
  276. will scan your source modules and generate a file named
  277. with a ".dfn" file extension appended to the file name.
  278.  
  279. This resultant file contains a summary of the exported
  280. objects from the file.  In other words, the xdef utility
  281. condenses an entire source module into only those items
  282. which are visible to clients (importers) of that module,
  283. and does not show the inner details.
  284.  
  285. To execute under MSDOS, type:
  286.  
  287.         xdef <filename>
  288.  
  289. and the result file will be generated silently.  Two
  290. important notes: 1) the source should be error-free
  291. before using xdef: xdef expects reasonably correct syntax;
  292. 2) if you forget to specify a file name, xdef halts
  293. with an error code.
  294.  
  295.  
  296.  
  297. OBERON-M(tm) SPECIFICS FOR MSDOS
  298.  
  299. Under MSDOS, some semantics for use that cannot
  300. be avoided are:
  301.  
  302. * User HALT codes must be greater than 100.
  303.  
  304. * The SYSTEM module built-into the compiler is
  305.   for MSDOS, but has the same exported objects
  306.   as defined in the language report (obrept.ps).
  307.  
  308. * Running under DOS requires a "main" module
  309.   that does not export anything, and which must
  310.   be the first one named in the list of files
  311.   linked together.
  312.  
  313.  
  314.  
  315.  
  316. OTHER READING
  317.  
  318. You may find more information about Oberon in the
  319. following articles:
  320.  
  321. N. Wirth        "Type Extensions"
  322.         ACM Trans. on Prog. Languages and Systems
  323.         10,2 (April 1988) 204-214
  324.  
  325. N. Wirth        "From Modula to Oberon"
  326.         Software- Practice and Experience 18,7
  327.         (July 1988) 661-670
  328.  
  329. N. Wirth        "The Programming Language Oberon"
  330.         Software- Practice and Experience 18,7
  331.         (July 1988) 671-690
  332.     ***Note: the updated report of the language
  333.     is included with this package and supercedes
  334.     this report*****
  335.  
  336. N. Wirth and J. Gutknecht
  337.         "The Oberon System"
  338.         Software- Practice and Experience 19
  339.         (September 1989) 857-893
  340.  
  341.  
  342.  
  343.  
  344. TECHNICAL NOTES
  345.  
  346.   At ETH Zurich, Niklaus Wirth and his associates have written
  347.   a closed-environment operating system based entirely upon
  348.   Oberon, called the Oberon System. This was written for
  349.   a specially built workstation, and has been ported to a
  350.   few other platforms, but not MSDOS or Intel processors
  351.   at the time of this writing.  
  352.   
  353.   Oberon-M is not intended to be a complete operating system,
  354.   but is to provide a means to use the Oberon language to write
  355.   programs under the hugely popular MSDOS environment.
  356.   
  357.   Oberon-M is source compatible with ETH's Oberon System.  
  358.   Excepting for system dependent modules, all applications 
  359.   written on this Oberon-M compiler are expected to run 
  360.   without source changes under the ETH Oberon System.
  361.   
  362.   There are a few technical items which the Oberon-M programmer
  363.   needs to keep in mind, however.  These are listed below.
  364.   
  365.         1) No floating point support in this release (ie,
  366.            the REAL and LONGREAL data types are not allowed).
  367.         2) 8088 and 8086 (ie: the oldest Intel processors) do 
  368.            not have Enter and Leave instructions which are
  369.            generated by the compiler.  Thus, only PCs
  370.            with 80x86 (where x >= 1) processors can
  371.            use the produced code.  The compiler itself will
  372.            run on an older machine, though.  People with
  373.            older machines have had good success (and a faster
  374.            machine) by adding 80x86 accellerator boards or
  375.            replacing 8086 chips with non-Intel 80x86 chips
  376.            with the same pin configurations.
  377.         3) The produced code has not been tested under all
  378.            versions of MSDOS that exist in the world, but
  379.            I anticipate no problems.  Some of the library
  380.            modules may have differences in internal
  381.            calls for very-odd MSDOS flavors; source for
  382.            these are supplied so you may make modifications
  383.            if you are running one of these rare DOS systems.
  384.         4) The ETH Zurich Oberon System permits "code
  385.            procedures" identified by a minus sign in the
  386.            procedure header.  This is non-standard, very
  387.            machine dependent, and not allowed on my compiler.
  388.            However, module SYSTEM exports a predefined
  389.            CODE procedure which takes bytes to insert 
  390.            in the instruction stream.
  391.         5) You MUST use the compiler hint "*" on a procedure
  392.            definition if that procedure is going to be 
  393.            assigned to a procedural-typed variable (so
  394.            that 80x86 long-calls will be generated). 
  395.            This looks like this, and is part of the
  396.            Oberon language:
  397.             PROCEDURE * MyHandler(....
  398.        Trying to assign a procedure without the "*"
  399.        indicator results in a type incompatibility
  400.        error at compile time. Note that this is
  401.        different than the export mark "*" which
  402.        follows the procedure name.
  403.        This is not required for procedures that are
  404.        exported from a module. 
  405.         6) Due to the irregularities of the 80x86
  406.            architecture, code generation for it is 
  407.            ponderous. In my experience
  408.            most professional programmers don't need,
  409.            or want, the overhead of range or stack
  410.            checking, so that is not provided.  Of course,
  411.            this is a debatable issue. 
  412.         7) The machine-dependent module known to the
  413.            compiler is called SYSTEM, and has the same
  414.            objects as shown in the language report. For
  415.            compatibility with release 1.0 of Oberon-M,
  416.            you may also use the name SYS, but SYSTEM is
  417.            preferred for all new applications.
  418.         8) The Oberon System in Zurich has an effective garbage
  419.            collection system. Oberon-M, running under MSDOS, 
  420.            cannot have such a garbage collector unless it 
  421.            wishes to take over the memory-management roles 
  422.            that MSDOS tightly holds onto.
  423.         9) The predefined procedure LEN only works on 
  424.            open arrays.  Built-ins such as LEN and SIZE return
  425.            integer values (instead of the ETH preferred
  426.            LONGINTs).  This is more consistent with the
  427.            limitations of the 80x86's architecture. Note
  428.            that integers are compatible (included in)
  429.            long integers and will convert automatically.
  430.         10) Because of the 80x86's addressing scheme of 
  431.            wrapping addresses at 64KB boundaries without
  432.            any error indication being given, Oberon-M does 
  433.            not allow arrays larger than 32KB.  However, 
  434.            applications that can be mindful of the 64KB
  435.            segmentation limits of the machine can address
  436.            larger objects with address arithmetic or
  437.            pointers.
  438.  
  439.  
  440.  
  441. HOW TO CONTACT THE AUTHOR
  442.    Please send e-mail to Internet address
  443.    
  444.           erv@k2.everest.tandem.com
  445.           IP address 130.252.59.153
  446.           
  447.    Written notes can be mailed to this address:
  448.        P. O. Box 58
  449.        Morgan Hill, California 95038
  450.        U.S.A.   
  451.    
  452.    
  453.                -- E. R. Videki  24 April 1991
  454.  
  455.                
  456.