[Oberon] Bit manipulation in Oberon-07

Jörg joerg.straube at iaeth.ch
Wed Oct 24 22:33:19 CEST 2018


For the Wiznet case, I never used SET for my implementation. Did all with pure INTEGER arritmetic.

I defined INTEGER constants for all those ‚bits’ definitions (shifted to the right place) and just added them...


> Am 24.10.2018 um 20:25 schrieb Skulski, Wojciech <skulski at pas.rochester.edu>:
> Aubrey:
>  in general, your comment is excellent! Yes, in case of memory mapped registers they could map the registers as SETs laid out at given addresses. The address mapping has to be done with SYSTEM anyway.
> However, in this particular case they are sending data over SPI to Wiznet W5500. The SPI library is written in terms of bytes, words, and so on. Sometimes it is pure data directed to Ethernet. Sometimes the datum is directed to an internal W5500 register. In the former case the integer is more appropriate, while in the latter case a SET would be more appropriate.
> We can devise a library where formal parameters would be SET, and use it if the datum is going to a register. It would mean devising a dedicated function for setting up the register, using SPI protocol.
> I suspect that we are facing the SET <--> INTEGER conversion somewhere along the chain, no matter how we implement the drivers. At the end of the day we need both BITS and ORD, or their functional equivalents.
> Wojtek
> ________________________________________
> From: Oberon [oberon-bounces at lists.inf.ethz.ch] on behalf of Aubrey McIntosh [aubrey.mcintosh at utexas.edu]
> Sent: Wednesday, October 24, 2018 2:10 PM
> To: ETH Oberon and related systems
> Subject: Re: [Oberon] Bit manipulation in Oberon-07
> If they are manipulating a hardware register that is based on bits, why is the data ever in the form of an integer?
> --
> 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