(16C) WSIZE? Determine word size
|
03-30-2019, 09:27 PM
Post: #1
|
|||
|
|||
(16C) WSIZE? Determine word size
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:
Remember kids, "In a democracy, you get the government you deserve." |
|||
03-31-2019, 01:45 AM
(This post was last modified: 03-31-2019 03:30 PM by mfleming.)
Post: #2
|
|||
|
|||
RE: (16C) WSIZE? Determine word size
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! Remember kids, "In a democracy, you get the government you deserve." |
|||
03-31-2019, 02:36 PM
Post: #3
|
|||
|
|||
RE: (16C) WSIZE? Determine word size
ah! yes, that's very nice
thanks for that. Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot/C47 Casio, Rockwell 18R |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)