[Oberon] [EXT] Re: Emulating interrupts in oberon-risc-emu as in the RISC5 specification

Chris Burrows chris at cfbsoftware.com
Wed Mar 31 06:18:47 CEST 2021


Wojtek,

The language report dated Revision 1.10.2013 / 3.5.2016 states "individual implementations may include in their module SYSTEM additional definitions that are particular to the specific, underlying computer". SYSTEM.LDPSR is one of those. Its use is shown in the document "An Update of the RISC5 Implementation" ("RISC5 Update"), which you can download from Prof Wirth's Project Oberon site:

https://people.inf.ethz.ch/wirth/ProjectOberon/index.html

Regards,
Chris

Chris Burrows
CFB Software
https://www.astrobe.com/RISC5



> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Skulski, Wojciech
> Sent: Wednesday, 31 March 2021 2:22 PM
> To: ETH Oberon and related systems
> Subject: Re: [Oberon] [EXT] Re: Emulating interrupts in oberon-risc-
> emu as in the RISC5 specification
> 
> Joerg:
> 
> what is SYSTEM.LDPSR? It does not seem to be present in the language
> report dated Revision 1.10.2013 / 3.5.2016, which I just downloaded
> from Paul's website.
> 
> Wojtek
> 
> 
> ________________________________________
> From: Oberon [oberon-bounces at lists.inf.ethz.ch] on behalf of J rg
> [joerg.straube at iaeth.ch]
> Sent: Tuesday, March 30, 2021 8:45 PM
> To: ETH Oberon and related systems
> Subject: [EXT] Re: [Oberon] Emulating interrupts in oberon-risc-emu
> as in the RISC5 specification
> 
> Although TestInt is low-level, it should use Kernel.Install
> (SYSTEM.ADR(Int), 4) to make it a little bit less low-level??
> 
> This little wrapper makes interrupts a little bit better consumable:
> MODULE Interrupts; (* jr/31mar21 *)
> IMPORT S := SYSTEM, Kernel;
> PROCEDURE Install*(handler: PROCEDURE);
>   BEGIN Kernel.Install(S.ADR(handler), 4) END Install; PROCEDURE
> Set*(on: BOOLEAN);
>   BEGIN S.LDPSR(ORD(on)) END Set;
> END Interrupts.
> 
> With it TestInt.Mod gets
> MODULE TestInt;
> IMPORT Interrupts;
> VAR led, cnt: INTEGER;
> PROCEDURE* MyInterrupt;
>   BEGIN
>     INC(cnt); IF cnt = 500 THEN led := 3-led; LED(led); cnt := 0 END
>   END MyInterrupt;
> PROCEDURE On*; BEGIN Interrupts.Set(TRUE) END On; PROCEDURE Off*;
> BEGIN Interrupts.Set(FALSE) END Off; BEGIN
>   led := 1; cnt := 0; Interrupts.Install(MyInterrupt) END TestInt.On
> TestInt.Off
> 
> Interrupts.Mod could be enhanced servicing multiple interrupt
> handlers. Comparable to the background tasks in Oberon.Mod. This
> enhancement would install its own interrupt handler doing the
> scheduling, and the user s  interrupt handlers  are normal procedures
> without * marking of the procedure. You would then install your
> handler like this PROCEDURE MyTask; BEGIN led := 3 - led; LED(led)
> END MyTask; BEGIN led := 1; Interrupts.Install(MyTask, 500) END
> TestInt.
> 
> br, J rg
> 
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related
> systems https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list