Victor Technology V12 manual Branch & Loop Programs, Branching with Conditions

Page 63

V I C T O R T E C H N O L O G Y

Chapter 6: Branch & Loop Programs

Program instructions typically execute sequentially through program line numbers, but it is possible to transfer or ‘branch’ to a program line that is not the next line of program memory.

Using the GTO instruction in a program will transfer an execution to any program line by using the designated three digit code of that line within the GTO command. After a branch, execution will resume sequentially as normal. For example, if program line 008 contains the command r GTO 004, then program line 004 will be executed after program line 008.

When the GTO instruction describes a lower number program line, the instructions contained within the lines between that line and the GTO instruction will be performed repeatedly. This is called ‘looping’.

To terminate the execution of a loop, insert a r x<y , r x=0 , or R/S instruction within the loop. Also, touching any key while executing the loop will stop the program.

Branching with Conditions

Sometimes you will need to branch to different lines of program memory, conditionally. There are two conditional test instructions used in program of conditional branching.

r x<y determines whether the value in the x-register is less than or equal to the value in the y-register. The x-register holds the number currently displayed in run mode and the y-register holds the number in the display when you touched ENTER. (Touching 3 ENTER 9 would store 3 in the y-register and 9 in the x-register.)

r x=0 determines whether the value in the X register is equal to 0.

Using these instructions will either:

63

Image 63
Contents Owners Guide V12 Financial Calculator Preface Where to Start Other Financial Calculations Branch & Loop Programs Where to Start Entering Small Amounts Entering Large AmountsEntries Display EEXUsing the Clear Function ALG and RPN Setting FunctionsSequential Calculations in ALG method RPN method Sequential Calculations in RPN methodStorage Capacity and Recalling Entered Data C T O R T E C H N O L O G Y Saving to a Register Using the Financial Storage RegistersResetting Saved Data First Steps to Financial FunctionsCHS INTEntries ALG Display Entries RPN Display Positive and Negative Cash Flows Basic Financial CalculationsTerm Definition KEY PMTDetermining Interest Rate Solving for Special relationship between i and nDetermining Present Value Solving for PV Determining Payment Amount Solving for PMT Entries Display FINDetermining Future Value Solving for FV Loan With Balloon Payment Determining Number of Periods Solving for nAmortization Function Amort Other Financial Calculations RCLNPV Net Present Value Entries Display REG CHS CF0Grouped Cash Flows Entries RPN Display REG Replacing Current Cash Flow Value Data STONPV Determining Values with Depreciation Entries RPN Display RCL500.00 Determining Bond Values YTM PriceENTER/= PercentagesALG method, calculate 35% of $1,200 Calendar Operations Determining Number of Days Between Dates Date∆DYS Other Operational Features Decimal Place Display SettingsStatus Icons Scientific Notation Display Settings Underflow and Overflow Display Other Display Settings Error DisplayFull Figure Display PrefixLST Running Display↔ y Statistical Features and FunctionsRecovering Incorrectly Entered Statistical Data Child Height Inches Weight lbs = = y-values Values Standard Deviation EntriesMean Values Linear Estimates for x and y Weighted Mean Values Entries Display Mathematical Features and FunctionsRounded Values FracInteger Values IntgRND Factorial ValuesExponential Values Logarithm Values Square Root ValuesSquared Values Reciprocal Values Power Features in ALG method Power Features in RPN methodEntries ALG Display Enter Creating Your Own Program Basics of ProgrammingSets the calculator to program function Prgm Executing Your Own Program Determining Program Line Instructions Program Memory BasicsExamples Performing a Program One Line at a Time Program line 000 and the GTO 000 instruction000 Sets calculator to program mode 001 SST Interrupting a Program During Execution Setting the Calculator to a Specific Program Line Pause 006 Stopping a Program During Execution Entries RPN Display Branching with Conditions Branch & Loop ProgramsExample GTO Storing More Than One Program Editing Your Programs Inserting Instructions Into a Program 002 003 004 005 006 007 008 009,43,33,000 Inserting Instructions at the End of a Program C T O R T E C H N O L O G Y Error Cause Error MessagesVictor Technology LLC