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

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

Postby floppy_stuttgart » Sat May 07, 2022 3:36 pm

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.
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

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

Postby pcscote » Sat May 07, 2022 7:06 pm

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
User avatar
pcscote
.......
.......
 
Posts: 30
Joined: Sat Oct 25, 2014 1:24 pm
Location: Québec/Canada

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

Postby floppy_stuttgart » Sun May 08, 2022 6:28 pm

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.).
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

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

Postby mike-stgt » Wed May 11, 2022 1:02 pm

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.
mike-stgt
.........
.........
 
Posts: 179
Joined: Tue Dec 24, 2019 12:12 pm

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

Postby dlachieze » Wed Aug 17, 2022 7:43 pm

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.
dlachieze
......
......
 
Posts: 28
Joined: Wed Mar 11, 2009 9:39 am

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

Postby floppy_stuttgart » Sun Aug 21, 2022 2:39 pm

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.
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest