Page 1 of 1
Numeric case not implemented
Posted: Tue Mar 22, 2016 6:59 pm
by hansklaver
In Astrobe for FPGA RISC5 using a CASE statement with a selector (case label) of type INTEGER or BYTE gives a compiler error "numeric case not implemented". I would not have expected this, because the language report does not mention it, and in the discussions on this forum I was unable to find anything about it.
Where can one find information on the limitations of the CASE-statement for this compiler?
Re: Numeric case not implemented
Posted: Tue Mar 22, 2016 9:31 pm
by cfbsoftware
Omissions, restrictions, extensions and changes to Oberon in the RISC5 implementation are listed on Prof Wirth's website in the document
Oberon At A Glance. One of the items listed under Omissions and Restrictions is "Case statement for extended types only"
The whole of ProjectOberon was implemented without the use of any numeric CASE statements and the Project Oberon 2013 documentation only has examples of the use of the more recent type-test form of the CASE statement. This form of CASE statement is also now included in the Oberon Language Report.
There have been a number of discussions related to how the numeric CASE statement could be implemented in Oberon for RISC5 on the ETH Oberon Mailing list. I initially thought that suitable instructions did not exist in the RISC5 instruction set to implement the numeric CASE statement efficiently but have had second thoughts since then.
The Astrobe Cortex-M3, Cortex-M4 and Cortex-M7 Oberon compilers support both the numeric and type-test forms of the CASE statement.
Re: Numeric case not implemented
Posted: Sun Dec 25, 2016 11:52 am
by cfbsoftware
cfbsoftware wrote:I initially thought that suitable instructions did not exist in the RISC5 instruction set to implement the numeric CASE statement efficiently but have had second thoughts since then.
We have now completed this work (for CHAR as well as INTEGER and BYTE) as described in the message
Numeric CASE has now been implemented.