When ISZ/DSZ > ISG/DSE
|
05-23-2019, 11:51 PM
Post: #1
|
|||
|
|||
When ISZ/DSZ > ISG/DSE
Ran across something interesting (to me at least) in an HP KeyNotes issue.
The situation was on the HP-67, the I register contained either a zero or one. Goal was to use ISZ/DSZ to switch it. Think of it as a brain-teaser: "The X register contains either a zero or one. Flip the value without using any digit keys or X=? test conditionals." The solution presented was... ISZ DSZ DSZ ISZ which works. Then I started thinking. That's hard to do on the HP41 style structure. ISG won't work here. Thoughts? Try it on your HP67 or an emulator and help me think through how to do it this way on an HP41. No X=Y? or X=0? conditionals allowed. :-) |
|||
05-24-2019, 12:00 AM
Post: #2
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
SIGN
LASTX - |
|||
05-24-2019, 12:44 AM
Post: #3
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
Which certainly works on X as I laid it out. Thomas is a master. :-)
What proposals for a value in a memory register? |
|||
05-24-2019, 01:08 AM
Post: #4
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
--Bob Prosperi |
|||
05-24-2019, 02:59 AM
Post: #5
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
ACOS
SIN By Andrés Rodríguez, I think. |
|||
05-24-2019, 04:10 AM
(This post was last modified: 05-26-2019 03:59 AM by Paul Dale.)
Post: #6
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
On the 34S, I think the minimal real mode solution would be:
Code: NOT The 34S has both flavours of increment (i.e. ISG and ISZ). Pauli |
|||
05-24-2019, 12:59 PM
Post: #7
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
Thank you Gerson for remembering this old answer from me to an old similar challenge!
Andrés C. Rodríguez (Argentina) Please disregard idiomatic mistakes. My posts are mostly from old memories, not from current research. |
|||
05-24-2019, 01:31 PM
Post: #8
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE | |||
05-24-2019, 02:00 PM
(This post was last modified: 05-24-2019 02:01 PM by Gerson W. Barbosa.)
Post: #9
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
CHS
ISG X Two steps also, but Andrés Rodríguez’s solution should be still one byte shorter. |
|||
05-24-2019, 02:35 PM
(This post was last modified: 05-24-2019 02:37 PM by Thomas Okken.)
Post: #10
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
(05-24-2019 02:00 PM)Gerson W. Barbosa Wrote: CHS Andrés' solution looks unbeatable on size, but it is slower. Not a lot slower, to be honest, since it takes advantage of special cases in ACOS and SIN, so it really is quite brilliant. I wish I had thought of it. CHS ISG X is flawed because the ISG skips the next instruction in the 0 → 1 case... |
|||
05-24-2019, 04:02 PM
Post: #11
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE | |||
05-28-2019, 09:41 PM
Post: #12
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
Thomas, Gerson,
Your generous (and mostly undeserved) comments about [ACOS | SIN] made my day. Thank you!! Andrés C. Rodríguez (Argentina) Please disregard idiomatic mistakes. My posts are mostly from old memories, not from current research. |
|||
05-29-2019, 12:33 AM
Post: #13
|
|||
|
|||
RE: When ISZ/DSZ > ISG/DSE
(05-28-2019 09:41 PM)Andres Wrote: Thomas, Gerson, You are most welcome! Besides, unto Andrés what belongs to Andrés! :-) Here it is, exactly fourteen years ago now: A tiny solution for the 0<>1 toggle |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)