<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><div>Okay, you want to display decimal nbrs upto 00..99 and the interface to your segment display is BCD.</div><div><br></div><div><div dir="ltr"><div dir="ltr"><div>Then</div><div>SYSTEM.PUT(SEVENSEGADR,<br></div></div></div><div dir="ltr"><div dir="ltr"><div> val DIV 10*16 + val MOD 10);</div></div></div><div>does the job</div></div><div><br><div dir="ltr">br<br><div>Jörg</div></div><div dir="ltr"><br><blockquote type="cite">Am 31.03.2021 um 18:51 schrieb Jeff Maggio <jmaggio14@gmail.com>:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Thanks!<div><br></div><div>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</div><div><br></div><div>best,</div><div>Jeff</div><div><br></div><div><br></div><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Jeff
For bitwise operations SYSTEM.VAL is safe.<br>The hint to the garbage collection is rather meant in case you manipulate POINTERs by doing calculations on them using INTEGERs.<br>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:<br>SYSTEM.PUT(SEVENSEGADR,<br> val DIV 10*16 + val MOD 10);
Perhaps an other method would be to call SetVal with the hex value in the first place:<br>SetValue(73H);<br>and SerVal just does<br> SYSTEM.PUT(SEVENSEGADR, val)
br<br>Jörg</blockquote></div></div>
<span>--</span><br><span>Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems</span><br><span>https://lists.inf.ethz.ch/mailman/listinfo/oberon</span><br></div></blockquote></div></body></html>