(16C) show which bits are set in a number
|
03-04-2019, 12:57 AM
Post: #1
|
|||
|
|||
(16C) show which bits are set in a number
I just wrote my first (!) RPN program.
I'm posting it here not because I think it will be of any great use to anyone but me, as it's likely naive in the extreme, but I would appreciate any criticism on how it might be improved, better RPN techniques, etc. It turned out rather more unwieldy than I'd hoped. I'm not concerned about performance, but I would like minimise the precious resources used, e.g. registers/lines/labels. It simply shows what bit positions are set in whatever is in X, using a single PSE to show each bit position. When I'm decoding values, I often find myself counting bits: ah yes, bits 15 and 11 are set in that MMU register, let's see what that means. And I'm often miscounting, losing place, etc. Alternatively, debugging C code like: Code: if (value & 0x00003800) Here's the code: Code: LBL A Thanks very much indeed for any comments. Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot Casio, Rockwell 18R |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)