home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / oberon / readme < prev    next >
Text File  |  1991-08-24  |  21KB  |  543 lines

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