[Oberon] Bit manipulation in Oberon-07
Skulski, Wojciech
skulski at pas.rochester.edu
Wed Oct 24 20:25:35 CEST 2018
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?
More information about the Oberon
mailing list