Fwd: Re: Bit manipulation in Oberon-07
...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 ?
oops, a hardware mind thinking how to masking 3 bits; "111" => 7. thanks. El 31/10/18 a las 09:42, Claudio Nieder escribió:
Hi,
b := a DIV 100H MOD 7;
MOD 8 IMHO.
claudio -- Claudio Nieder, Ruhestrasse 7, CH-8045 Zürich, Tel +4179 357 6743, www.claudio.ch <http://www.claudio.ch>
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (3)
-
Claudio Nieder -
Walter Gallegos -
Walter Gallegos