[Oberon] Oberon 3 on Windows 7, PELinker, Windows executable

Dieter d.gloetzel at web.de
Sun Mar 15 18:59:37 CET 2015


Hi Chris,

thanks for your recommendations. I tried, what you told me. But I did 
not succeed. It seems I am lacking some crucial information.

o.k. with the HelloCon-example:

Compile->Link->Register->Run and "Hello from Oberon!" appears on the 
DOS-Console. This example is somewhat limited.
It does not tell me how to deal with an executable Oberon Procedure in a 
Module or maybe several of these in one Module.

Then I tried to extend this in a way that the EXE would read a parameter 
from the command line.
Since I do not know the intricacies of the Kernel32-Library, I tried the 
following:
The only idea I had was to try to use the parameter mechanism of Oberon
   and hope that this would be magically transferred to the executable.
================================================================
MODULE HelloConRead;
     IMPORT Kernel32, Texts, Oberon;
VAR S : Texts.Scanner;
BEGIN
Texts.OpenScanner(S,Oberon.Par.text, Oberon.Par.pos);
Texts.Scan(S);
     Kernel32.Str(S.s); Kernel32.Ln()
END HelloConRead.
==============================================================

Is this idea at all correct?

A batch solution like << /myprogram.exe "path to input file" "path to 
output file"/>> would be sufficient for my present task.
But could one also produce screen oriented interactive Windows programs 
from Oberon code?
==============================================================
o.k. for the Compiler: Builder.Compile \s HelloConRead.Mod ~
==============================================================
Then I modified the HelloCon.Link statement to include the Oberon and 
Text modules
and changed the OriginalFilename to "HelloConRead.exe"

When I call:  PELinker.Link HelloConRead.Link ~,
there is a crash, and I have no chance to go any further.
============================================
P 100  HALT statement in thread Oberon.Loop

BootLinker.Halt  PC = 1857
     msg = "Imported module not loaded"
BootLinker.ReadImport  PC = 10781
     R =  00416E98H Files.Rider
     m =  0218E840H BootLinker.ModuleDesc
BootLinker.LoadModule  PC = 16007
     R =  00416E98H Files.Rider
     base = 4272060
     body = NIL
     ch =  00000000X
     e = 0
     i = 12
     imp =  00000000H (BootLinker.ModuleDesc)
     j = 0
     k = 0
     m =  0218E840H BootLinker.ModuleDesc
     mname = "Modules"
     mno = 3
     nofDataLinks = 29
     nofLinks = 3
     symSize = 1564
     t = 0
     tmp = 476
BootLinker.Load  PC = 18567
     R =  00416E98H Files.Rider
     base = 4272060
     f =  02111D00H Files.File
     fname = "Oberon.Obj"
     imp =  00000000H (BootLinker.ModuleDesc)
     m =  0218E840H BootLinker.ModuleDesc
     name = "Oberon"
     tag =  000000AFX
PELinker.DoLink  PC = 22134
     F =  0216F260H Files.File
     R =  00416E98H Files.Rider
     T =  0215BB00H Texts.TextDesc
     base = 4272060
     context =  0042DBB8H Exceptions.Context
     done = FALSE
     mod =  0218E840H BootLinker.ModuleDesc
     name =  0215C3C0H PELinker.NameList
     offs = 0
     sections = 3
PELinker.Link  PC = 23391
     S =  00447178H Texts.Scanner
     T =  0215BB00H Texts.TextDesc
     done = FALSE
Oberon.Call  PC = 5931
     Mod =  02133D60H Kernel.ModuleDesc
     P = PELinker.Link  PC = 22948
     cur =  01E9DE80H Windows.Window (Displays.Display)
     f =  01F99520H Desktops.DocViewerDesc (Objects.ObjDesc)
     i = 9
     j = 13
     name = "Link"
     new = FALSE
     par =  02132BC0H Oberon.ParRec
     res = 1
TextGadgets0.Call  PC = 16652
     A =  0041F1B8H Objects.AttrMsg
     F =  01E60B80H TextGadgets.FrameDesc (TextGadgets0.FrameDesc)
     R =  00447218H Texts.Reader
     S =  00447178H Texts.Scanner
     ch =  00000000X
     chl = 32767
     cmd = ""
     cw = 32767
     cx = 0
     cy = 0
     dlink =  01FA30E0H Documents.DocumentDesc (Objects.ObjDesc)
     i = 8
     j = 0






Am 14.03.2015 um 02:59 schrieb Chris Burrows:
> Hi Dieter,
>
> Read Chapter 6.6 "Building EXE and DLL Executable Files with Oberon" in the Oberon UserGuide (Docu/UserGuide.Text) for information on how to use PELinker.Tool
>
> If you follow those instructions and get stuck let me know how far you got and I'll see if I can help. I would recommend proceeding step by step e.g.:
>
> 1. Start with the simple sample that they provide and confirm that you can get that working
> 2. Write a simple example that accepts filenames as command-line parameters and confirms that the input file exists and checks that the output file doesn't exist.
> 3. Start working on your actual application,
>
> Regards,
> Chris
>
> Chris Burrows
> CFB Software
> Oberon for ARM Cortex-M3 and M4
> http://www.astrobe.com
>   
>
> From: Dieter [mailto:d.gloetzel at web.de]
> Sent: Friday, 13 March 2015 10:11 PM
> To:oberon at lists.inf.ethz.ch
> Subject: [Oberon] Oberon 3 on Windows 7, PELinker, Windows executable
>
> Hi,
>
> I am new to this list, but do have some 20 years experience with Oberon on Windows.
> Still there are things which I do not fully understand, e.g. PELinker and Oberon debugger.
>
> Right now I am working on an application which translates MusicXML (a proprietary language to describe musical notes) into another input language, called PMX, which in turn generates TeX-code for typesetting notes.
>
> Is there anywhere out in Cyber Space someone, who could give me a helping hand on how to use PELinker in order to transform an Oberon-Module into a Windows *.exe, so that I can call it from the WIndows command line in the following form:
> myprogram.exe "path to input file" "path to output file"
>
> Thanks and regards,
> Dieter
>
>
> --
> Oberon at lists.inf.ethz.ch  mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>


-- 
____________________________________
Dr. Dieter Glötzel
Im Rosengarten 27
64367 Mühltal
Tel.: 06151 / 360 82 72

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/oberon/attachments/20150315/bd4c610f/attachment.html 


More information about the Oberon mailing list