(16C) WSIZE? Determine word size - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (16C) WSIZE? Determine word size (/thread-12710.html) |
(16C) WSIZE? Determine word size - mfleming - 03-30-2019 09:27 PM The 16C can set the word size from 1 to 64 bits but has no way to retrieve the value of that setting. So everyone ends up shifting a 1 leftward across a word until the carry is set. Here is a simple routine that only affects the X register, to which is returned the current word size. Code:
RE: (16C) WSIZE? Determine word size - mfleming - 03-31-2019 01:45 AM I'm embarrassed to say I've managed to make a right turn by taking three lefts! As cdmackay's program comment reminded me, there's a much simpler way to get the word size. Code:
NB: Replace "CLx" in the second line with "0" to preserve the content of the X register. This code is now a semi-permanent resident as LBL F in memory! RE: (16C) WSIZE? Determine word size - cdmackay - 03-31-2019 02:36 PM ah! yes, that's very nice thanks for that. |