[Oberon] FPGA - SET initialisation

Alexander Ilin ajsoft at yandex.ru
Sun Apr 30 11:59:22 CEST 2017


s := { 10 }; makes a SET with 10th bit => s = 0x0400

So, I don't think s := { i } does what you think it would.

30.04.2017, 12:44, "Tomas Kral" <thomas.kral at email.cz>:
> Hi,
>
> Reading `SET - neglected data type',
> I was wondering, how I could best initialise a SET variable.
>
> VAR b: BYTE, i: INTEGER, s: SET;
> ...
> SYTEM.GET(adr, s); (* reading 4 bytes from adr, easiest but adr MOD 4!
> *)
> ...
> SYTEM.GET(adr, i); s := {i}; (* same result as above? *)
> ...
> (* provided adr MOD = 0 *)
> SYTEM.GET(adr+0, b); s := {b}; (* same result as above? *)
> SYTEM.GET(adr+1, b); ASL(s,8); s := s + {b};
> SYTEM.GET(adr+2, b); ASL(s,8); s := s + {b};
> SYTEM.GET(adr+3, b); ASL(s,8); s := s + {b};
>
> Tomas
> --
> 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