Post Reply 
12c clr reg not programmable, why?
01-03-2020, 12:27 PM
Post: #1
12c clr reg not programmable, why?
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?
Find all posts by this user
Quote this message in a reply
01-03-2020, 07:58 PM
Post: #2
RE: 12c clr reg not programmable, why?
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.
Find all posts by this user
Quote this message in a reply
01-03-2020, 09:34 PM
Post: #3
RE: 12c clr reg not programmable, why?
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?
Visit this user's website Find all posts by this user
Quote this message in a reply
01-03-2020, 10:09 PM
Post: #4
RE: 12c clr reg not programmable, why?
(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.
Find all posts by this user
Quote this message in a reply
01-03-2020, 11:01 PM
Post: #5
RE: 12c clr reg not programmable, why?
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.

There are only 10 types of people in this world. Those who understand binary and those who don't.
Find all posts by this user
Quote this message in a reply
01-04-2020, 07:56 PM
Post: #6
RE: 12c clr reg not programmable, why?
(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
Find all posts by this user
Quote this message in a reply
01-04-2020, 09:22 PM
Post: #7
RE: 12c clr reg not programmable, why?
(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?

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

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.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-04-2020, 09:43 PM
Post: #8
RE: 12c clr reg not programmable, why?
(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.

Csaba

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.

Yes, good point, but the number of CFs is stored in 'n'.
Find all posts by this user
Quote this message in a reply
01-05-2020, 12:20 AM
Post: #9
RE: 12c clr reg not programmable, why?
(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.
Find all posts by this user
Quote this message in a reply
01-05-2020, 03:36 AM
Post: #10
RE: 12c clr reg not programmable, why?
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.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
01-05-2020, 09:51 AM
Post: #11
RE: 12c clr reg not programmable, why?
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
Find all posts by this user
Quote this message in a reply
01-05-2020, 12:05 PM
Post: #12
RE: 12c clr reg not programmable, why?
(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...

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
01-05-2020, 02:48 PM
Post: #13
RE: 12c clr reg not programmable, why?
(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.

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.

sheesh. Somebody better check and make sure CLR REG doesn't enter the launch codes for our Polaris nuclear missles!
Find all posts by this user
Quote this message in a reply
01-05-2020, 03:01 PM
Post: #14
RE: 12c clr reg not programmable, why?
(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.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-05-2020, 10:38 PM
Post: #15
RE: 12c clr reg not programmable, why?
(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. Smile

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)