[Oberon] How to use SYSTEM.VAL safely?

Jeff Maggio jmaggio14 at gmail.com
Wed Mar 31 18:50:39 CEST 2021


Thanks!

I'm actually using binary-coded decimal, which is a little different. I'm
writing two separate 4bit decimal digits alongside each other. Each 4bit
field drives a separate seven segment display on our embedded board

best,
Jeff


Jeff For bitwise operations SYSTEM.VAL is safe.
> The hint to the garbage collection is rather meant in case you manipulate
> POINTERs by doing calculations on them using INTEGERs.
> Common low-level programming practice BTW: If I understand correctly what
> you want to do with SetVal is, interprete the decimal input value as hex
> nbr. SetVal(73) will store value 115 at address SEVENSEGADR. If so, I would
> code it as follows:
> SYSTEM.PUT(SEVENSEGADR,
> val DIV 10*16 + val MOD 10); Perhaps an other method would be to call
> SetVal with the hex value in the first place:
> SetValue(73H);
> and SerVal just does
> SYSTEM.PUT(SEVENSEGADR, val) br
> Jörg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20210331/29e9fa54/attachment.html>


More information about the Oberon mailing list