No HP-33S looping problem (and HP manuals) Message #4 Posted by Karl Schneider on 5 June 2005, 5:55 p.m., in response to message #1 by Don Shepherd
Don --
"DSE" means Decrement and Skip when less than or Equal to, as the HP-33S manual says. The function is unchanged from its implementation on numerous predecessor HP calc's, such as the 32SII, 32S, 42S, 11C, 15C, 41C, and 34C...
Executing the DSE statement with n.mmmkk (n = -9999999 to +9999999) stored in the "looping-variable" register will result in n being decremented by kk, and the instruction following DSE being skipped only if n <= mmm.
For n.mmmkk = 10.00101, if program execution is repeatedly returned to the DSE statement without any other operation changing the value of n.mmmkk, the instruction following DSE will be executed when n = 10, 9, 8, 7, 6, 5, 4, 3, and 2 -- a total of nine times.
It is noteworthy that DSE, ISG, DSZ and ISZ (both from the HP-16C) are operations that only modify a variable, check its value against the "goal", and dictate program execution on the result. These operations provide a convenient tool for automating looped processing, but they do not initiate a loop or determine the number of executions.
DSE and ISG are likened to a "FOR-NEXT loop" in the manuals for the 32S, 32SII, and 33S. However, they aren't functionally equivalent. Additional LBL and GTO instructions are usually needed to set up a conventional for-loop using DSE, ISG, DSZ or ISZ. A simple example:
(set up loop-control number)
STO I
LBL 0
("looped" instructions)
DSE I
GTO 0
(remainder of program)
Comment about quality of HP calculator manuals, starting with Pioneer models:
After seeing a few mistakes and misleading statements regarding DSE and ISG in the 32S and 32SII manuals, I looked at the 15C manual, which included no such gaffes on that topic (or any other topic, for that matter). I had previously noted that the writing in the manual of the 42S on a given topic wasn't as precise as that in the manuals of the HP-41 and the Voyager models (e.g., 15C). It's as though HP tried to simplify (read: "dumb down") the reference material, but degraded its quality in the process.
-- KS
Edited: 6 June 2005, 4:55 a.m. after one or more responses were posted
|