Page 1 of 1

INCREASING X by 1 is "ISG X", by 2 or 3 or 4?

PostPosted: Sat May 07, 2022 3:36 pm
by floppy_stuttgart
Hello,
for increasing X by 1 without moving the stack, we have the function "ISG X".
For increasing it by 2, we can do "ISG X" "ISG X".
Is anywhere another function to increase by 2 or 3?
example 3 would be: "ISG X" "ISG X" "ISG X" but it takes memory.
Any advise is welcome.

Re: INCREASING X by 1 is "ISG X", by 2 or 3 or 4?

PostPosted: Sat May 07, 2022 7:06 pm
by pcscote
Not that I know of.
ISG structure is iiiii.fffcc where iiiii is counter value, fff is the counter test and cc is the increment value.
So, if X has 23.00005 and you do ISG X , it will increment X by 5 to 28.00005.
Remember that if used in a program, ISG will skip the next line when the fff condition is met.
Ref: HP-41C/CV Owner's Handbook and Programming Guide, Controlled Looping, page 163.
Sylvain

Re: INCREASING X by 1 is "ISG X", by 2 or 3 or 4?

PostPosted: Sun May 08, 2022 6:28 pm
by floppy_stuttgart
Thanks. Increasing X by the value 3 could be (no movement of stack):
If so far the value "10" is in X (integer for making later for example STO IND Y), then
ISG X
""
ISG X
""
ISG X
""
would increase X by 3 and the stack has not moved.
Result in X would be 13.

Any other function like "ST3+" X would have been better (perhaps I must make it..).
Same for "ST2+" X
Increasing by 1 can stay
Code: Select all
ISG X
""


comments/remarks are welcome.

Background: having 10 in X mean for me, the content of register 10 is the first value of a quaternion (a quaternion has 4 parameters).
Accessing the other values of the quaternion would be done via increasing X with 1 then 2 then 3 in a program (and RCL IND X etc.).

Re: INCREASING X by 1 is "ISG X", by 2 or 3 or 4?

PostPosted: Wed May 11, 2022 1:02 pm
by mike-stgt
floppy_stuttgart wrote:comments/remarks are welcome.

I assume it could be advantageous to keep in mind also other hypercomplex systems and save quaternion "objects" in vectors as offered by the HP-41 Advantage Advanced Solutions Pac. Incrementing/decrementing pointers would not need a NOP (saving more than 30%), and the "objects" would be somehow protected from accidental modification by underdone programming, as I did likewise with the "tape" data storage in my improvement of a Brainfuck interpreter on a HP15C.

Re: INCREASING X by 1 is "ISG X", by 2 or 3 or 4?

PostPosted: Wed Aug 17, 2022 7:43 pm
by dlachieze
floppy_stuttgart wrote:Thanks. Increasing X by the value 3 could be (no movement of stack):
If so far the value "10" is in X (integer for making later for example STO IND Y).

Note that STO IND Y (or RCL IND Y) will use the integer par of Y, so with 10.00003 in X, ISG X will increase X by 3 to 13.00003, then 1234 STO IND Y will store 1234 to register 13.

Re: INCREASING X by 1 is "ISG X", by 2 or 3 or 4?

PostPosted: Sun Aug 21, 2022 2:39 pm
by floppy_stuttgart
Thanks. I would like to keep the data in the registers as integer and not touch it. Extract of my current quaternion algebra below (FOCAL).

(main programm)
..
RCL 01 ;10 was in it
1.2345
XEQ "SQJY" ; save the value in X into i part of the quaternion which address is starting at Y
; Quaternion starting from address ind Y = in register 10:w, in register 11: i, in register 12:j, in register 13:k
; with the used form Q = w + i*x +j*y + k*z
..

(generic subroutines)
LBL "SQJY" ; save quaternion part j (in X) into register address given by Y
ISG Y
""
ISG Y
"" ; thats 4 lines above are ok.. works.. but I am missing the "beauty"
STO IND Y
RTN
..
LBL "SQKY" ; save quaternion part k (in X) into register address given by Y
ISG Y
""
ISG Y
""
ISG Y
"" ; thats 6 lines above are ok.. works.. but I am missing the "beauty"
STO IND Y
RTN


Probably I will have to make MCODE functions.
which will be "SQPJ 10" ; (= save quaternion part j into the register 10 where the quaternion start)
or "SQPJ ind 01"

"SQPW" is not necessary because "SQPW 10" is the same than "STO 10".
But SQPI and SQPK (and others like RCL or ST* ..) will have to be done, too.