(11C) Indirect Line Number Branches
|
07-17-2019, 06:04 AM
(This post was last modified: 07-17-2019 06:20 AM by Gamo.)
Post: #1
|
|||
|
|||
(11C) Indirect Line Number Branches
Going though the HP-11C User's Handbook on Page 137
Under Indirect Program Control there are two type: 1. Indirect Label Branches 2. Indirect Line Number Branches According to the user manual state that Indirect Label Branches the execution is transfer downward in program memory. But for Indirect Line Number Branches the manual doesn't said if it going downward only like the Label Branches or not. Remark: Is indirect label Branches only go downward in program memory..? ------------------------------------ This example program demonstrated that Indirect Line Number can be branches either downward and upward in program memory. Program to count down, count up and keep repeating. Example: 5 [A] display 4..3..2..1..0..1..2..3..4..5..4..3........ to stop press [R/S] Program: Code:
Gamo |
|||
07-17-2019, 07:34 AM
Post: #2
|
|||
|
|||
RE: (11C) Indirect Line Number Branches
(07-17-2019 06:04 AM)Gamo Wrote: According to the user manual state that It also says the same thing for a direct GTO, but that is not actually what happens or you would never be able to jump backwards in a program and perform loops. Yes, the search is downwards from the position where the GTO is, but once the last line in the program is reached, the search continues from the beginning. What this means is, if a label appears more than once in a program, e.g. once before your GTO and once after the GTO, then only the one below the GTO will ever be "seen" by the GTO. |
|||
07-17-2019, 08:56 AM
(This post was last modified: 07-17-2019 08:57 AM by Gamo.)
Post: #3
|
|||
|
|||
RE: (11C) Indirect Line Number Branches
Thanks for the feedback grsbanks
Just now I try the same program but use Indirect Label Branches Program: Indirect Label Branches Code:
Program using Indirect Label Branching also look like it branch upward in program as shown in above program. I did try it an it count down and up the same as the first program that use Indirect Line Branches. Remark: The last line of this program is GTO I that branch to [LBL] 1 is it going upward? Gamo |
|||
07-17-2019, 09:28 AM
Post: #4
|
|||
|
|||
RE: (11C) Indirect Line Number Branches
I think you're over-complicating things. There is no "should I branch upwards or downwards?" There is simply "I need to find LBL 1, wherever it is, and jump there."
Whether you do effectively jump upwards or downwards is purely dependent on the position of the label relative to your current position, but you only have to start asking questions about how the calculator actually finds the label if it occurs more than once in the same program. |
|||
07-19-2019, 03:16 PM
Post: #5
|
|||
|
|||
RE: (11C) Indirect Line Number Branches
Line junping to?
I'll read again to see this, as normally you can jump only tô labels. If really possible, GTO linexxx Will go directly to that line, it doesn't matter If backward or forward. ARTUR MARIO JUNIOR BRAZIL |
|||
07-19-2019, 03:23 PM
Post: #6
|
|||
|
|||
RE: (11C) Indirect Line Number Branches
(07-19-2019 03:16 PM)Artur - Brasil Wrote: Line junping to? The key here is the word "INDIRECT". Code: 1 This does the same thing as "GTO 1". But if the value that you store in the index register is negative then it jumps to the line whose number is the absolute value of the index register. E.g. to jump to line 45: Code: 45 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)