[Oberon] Fwd: Re: Bit manipulation in Oberon-07

Walter Gallegos waltergallegos at vera.com.uy
Tue Oct 30 01:42:10 CET 2018


> ...MOD/DIV are just other words for AND/ASR...
>
All times I use SET when working with hardware registers; so, I was 
curious about the generated code for MOD/DIV alternative

A simple test for extracting some bits from a 16 bits value

     a := 2345H;
     b := a DIV 100H MOD 7;

Generate :

10    40002345    MOV    R0    R0    9029
11    A0D00000    STR    R0    SB    0
12    80D00000    LDR    R0    SB    0
13    40020008    ASR    R0    R0    8
14    400B0007    DIV    R0    R0    7
15    20000000    MOV'    R0    R0    R0
16    A0D00004    STR    R0    SB    4

I forget something ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20181029/161a621c/attachment.html>


More information about the Oberon mailing list