Post Reply 
HP 41 - branching to local label and return stack - FINAL RESULTS AND PROGRAMS
06-23-2019, 02:40 AM
Post: #42
RE: HP 41 - branching to local label and return stack
Now, the LOGIC program.
Advantage and HP41 have some logic functions, but they were created for test 0 and 1 (binary information) as I understand.
My routines check if the data you passed to them are 0 or different of 0 and do not skip next line of program, they return 1 or 0 (true or false). A very simple idea, isn't it? I don't believe no one has ever needed such functions!!

1 LBL "LOGIC"
2 LBL "XORV"
3 SF 03
4 LBL "XORR"
5 X=Y?
6 GTO 01
7 R^
8 X=Y?
9 GTO 01
10 X<>Y
11 R^
12 LBL 01
13 RDN
14 RDN
15 FS?C 03
16 GTO 12
17 RCL IND X
18 RCL IND Z
19 GTO 12
20 LBL "XORA"
21 ATOX
22 STO L
23 CLX
24 89
25 ST- IND L
26 CLX
27 LASTX
28 X>0?
29 GTO 01
30 X<0?
31 GTO 02
32 RDN
33 X<>Y
34 GTO 01
35 LBL 02
36 RDN
37 LBL 01
38 RDN
39 LBL "XOR2"
40 LBL 12
41 XEQ 10
42 GTO 01
43 LBL "XOR3"
44 XEQ 10
45 GTO 02
46 LBL "XOR4"
47 XEQ 10
48 X<>Y
49 XEQ 10
50 +
51 LBL 02
52 X<>Y
53 XEQ 10
54 +
55 LBL 01
56 X<>Y
57 XEQ 10
58 +
59 X=0?
60 RTN
61 1
62 X=Y?
63 RTN
64 STO- X
65 RTN
66 LBL "X#0?L"
67 LBL 10
68 X#0?
69 GTO 01
70 RTN
71 LBL 01
72 1/X
73 ST/ X
74 RTN
75 LBL "X=0?L"
76 LBL 11
77 X=0?
78 GTO 01
79 1/X
80 ST- X
81 RTN
82 LBL 01
83 1
84 END

ARTUR MARIO JUNIOR
BRAZIL
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-23-2019 02:40 AM



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