[Oberon] Bit manipulation in Oberon-07
Jörg Straube
joerg.straube at iaeth.ch
Mon Oct 29 00:02:36 CET 2018
inline procedures or macros are not part of the Oberon-7 language. Some previous Oberon dialects had them...
SYSTEM procedures can be seen as kind of inline procedures as they look like procedure calls but are infact in a lot of cases just a wrapper to one assembler instruction.
I agree that for Oberon beginners MOD and DIV look quite cryptic and difficult to understand. MOD/DIV are just other words for AND/ASR...
Jörg
> Am 28.10.2018 um 22:32 schrieb Skulski, Wojciech <skulski at pas.rochester.edu>:
>
> Joerg:
>
> in most cases, standard coding is preferred over growing teh SYSTEM with custom instructions. On the other hand, IMHO I would prefer defining my own procedures and using them, over littering the high level code with cryptic low level statements. I admit it is a my personal preference.
>
> 1) UBFX(dst, src, 5, 10); <-- procedure call
> 2) dst := src DIV b5 MOD b10; <-- cryptic statement.
>
> In my own practice I would probably prefer #1. I would probably wrap #2 as a PROCEDURE and then call it in my high level code. But this would bring performance penalty on every call.
>
> This brings up another question: how about inline procedures? We could eat the cake and have the cake.
>
> Inlining is a standard practice in those inferior languages, you know ;-)
>
> Thank you,
> Wojtek
> --
> 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