12c clr reg not programmable, why? - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: 12c clr reg not programmable, why? (/thread-14303.html) |
12c clr reg not programmable, why? - Don Shepherd - 01-03-2020 12:27 PM I've often wondered about this. I can think of two possible reasons: 1. they ran out of keycodes 2. it clears more than just numbered registers (financial, stack, lastx) Does anyone have any insight or thoughts about this? RE: 12c clr reg not programmable, why? - Gene - 01-03-2020 07:58 PM Hey Don. I don't know. A couple of other functions are not programmable either: D.MY M.DY STO EEX in addition to CLR REG. RE: 12c clr reg not programmable, why? - Dave Britten - 01-03-2020 09:34 PM My guess would be the opcode table was full, but given how many different key codes the 15C has - and can fit into a single step on the same hardware - I'm not so sure. Do the 12C and 15C give you the same number of program steps per converted register? RE: 12c clr reg not programmable, why? - Don Shepherd - 01-03-2020 10:09 PM (01-03-2020 09:34 PM)Dave Britten Wrote: Do the 12C and 15C give you the same number of program steps per converted register? For the 12c it is 7. I don't know about the 15c. RE: 12c clr reg not programmable, why? - grsbanks - 01-03-2020 11:01 PM For the 15C is is 7 *bytes* merely because a register is 56 bits in all of the NUT-based systems, including the 41C. I emphasized *bytes* because, unlike other Voyagers, the 15C has some multi-byte opcodes, so one program step is not necessarily just one byte. RE: 12c clr reg not programmable, why? - Csaba Tizedes - 01-04-2020 07:56 PM (01-03-2020 12:27 PM)Don Shepherd Wrote: I've often wondered about this. Does anyone have any thoughts about this? Because it is totally useless. If you want to do anything with a stored value you must to store it into a register first. Therefore no need to clear one or all of them. Csaba RE: 12c clr reg not programmable, why? - Dave Britten - 01-04-2020 09:22 PM (01-04-2020 07:56 PM)Csaba Tizedes Wrote:(01-03-2020 12:27 PM)Don Shepherd Wrote: I've often wondered about this. Does anyone have any thoughts about this? Does the same hold true for programs that use the cash flow functions? I haven't used those much, so I'm not sure what - if anything - you have to clear first. RE: 12c clr reg not programmable, why? - Csaba Tizedes - 01-04-2020 09:43 PM (01-04-2020 09:22 PM)Dave Britten Wrote:(01-04-2020 07:56 PM)Csaba Tizedes Wrote: Because it is totally useless. If you want to do anything with a stored value you must to store it into a register first. Therefore no need to clear one or all of them. Yes, good point, but the number of CFs is stored in 'n'. RE: 12c clr reg not programmable, why? - Don Shepherd - 01-05-2020 12:20 AM (01-04-2020 07:56 PM)Csaba Tizedes Wrote: Because it is totally useless ... Therefore no need to clear one or all of them. Clearing a register is not a useless idea, it is a requirement if you are going to use a given register as a counter and you want to make sure it starts out as 0. This is a basic principle that new programmers learn on day one. True, you can always store 0 in any register, but if you are going to tally 5 different things in 5 registers CLR REG might come in handy. I admit that it might be a bad idea to have CLR REG command in a 12c program because it is going to clear everything including the value in X which you normally use to input a value into a program on the 12c. This would not be a problem on the HP-65 since CLR REG does not clear the stack as it does on the 12c. RE: 12c clr reg not programmable, why? - rprosperi - 01-05-2020 03:36 AM Since CLR REG destroys all data everywhere (storage and financial registers as well as the stack, including LASTX) it really serves no purpose in a program, except perhaps as the initial step to clear everything in a program which will then go on to initialize values and proceed with calculations, but if so, the user could simply execute CLR REG manually just prior to running the program. Also, I just checked and confirmed the CLR REG operation also resets the user program counter, thus use in a program would be suicide as it would reset to line 00 and halt. RE: 12c clr reg not programmable, why? - Csaba Tizedes - 01-05-2020 09:51 AM Because on 12C and all 1xC calculators if you clear registers the free memory is not change, no meaning of CLEAR REG. If you want to initialise your counters simple store the requested value in the counter register. If you want to clear R1 to R6 use CLEAR SUM. On my 32SII I use frequently the CLEAR command, because if you store 0 in a register that RAM area is added to program memory. In this case the CLEAR REG is important command. BTW: in my understanding the "initializing a variable" not means "store 0 in a register". On CASIO fx-4000P or 4500P the variables exists like on 12C and if you want to initialise registers you can use "~" command like: 100 STO A~F. This is more flexible than CLEAR. I can imagine a "SETREG" command on the future HP calcs with value ENTER from ENTER to SETREG syntax, which set the registers on the range Rfrom to Rto to value. Csaba RE: 12c clr reg not programmable, why? - Massimo Gnerucci - 01-05-2020 12:05 PM (01-05-2020 09:51 AM)Csaba Tizedes Wrote: I can imagine a "SETREG" command on the future HP calcs with value ENTER from ENTER to SETREG syntax, which set the registers on the range Rfrom to Rto to value. First of all you have to imagine future HP calcs... RE: 12c clr reg not programmable, why? - Don Shepherd - 01-05-2020 02:48 PM (01-05-2020 03:36 AM)rprosperi Wrote: Since CLR REG destroys all data everywhere (storage and financial registers as well as the stack, including LASTX) it really serves no purpose in a program, except perhaps as the initial step to clear everything in a program which will then go on to initialize values and proceed with calculations, but if so, the user could simply execute CLR REG manually just prior to running the program. sheesh. Somebody better check and make sure CLR REG doesn't enter the launch codes for our Polaris nuclear missles! RE: 12c clr reg not programmable, why? - Dave Britten - 01-05-2020 03:01 PM (01-05-2020 03:36 AM)rprosperi Wrote: Also, I just checked and confirmed the CLR REG operation also resets the user program counter, thus use in a program would be suicide as it would reset to line 00 and halt. Yeah, if it goes completely nuclear and clears the registers, stack, and resets the program counter and halts, then I definitely can't see any good use for it inside a program. But then one wonders why the command is labeled "CLR REG"; maybe a little picture of a frustrated accountant sweeping everything off the desk into the trash would be a better choice. (01-05-2020 09:51 AM)Csaba Tizedes Wrote: I can imagine a "SETREG" command on the future HP calcs with value ENTER from ENTER to SETREG syntax, which set the registers on the range Rfrom to Rto to value. Doesn't the 41C Extended Functions have something similar? Or am I just thinking of the "copy a block of registers" command? In any case, you could implement it in just a few steps with ISG. RE: 12c clr reg not programmable, why? - rprosperi - 01-05-2020 10:38 PM (01-05-2020 03:01 PM)Dave Britten Wrote: Yeah, if it goes completely nuclear and clears the registers, stack, and resets the program counter and halts, then I definitely can't see any good use for it inside a program. But then one wonders why the command is labeled "CLR REG"; maybe a little picture of a frustrated accountant sweeping everything off the desk into the trash would be a better choice. A very intuitive and clear to grasp icon, but hard to get that into the small space available. However, a small mushroom cloud could just fit, and probably convey the same. |