Ski IA-64 Simulator Reference Manual 1.0L
#Compute and print Fibonacci numbers from 1 to 50.
#Initialize variables
= r10 | 1 | # Hold | |
= r11 | 1 | # Hold | |
= | r12 | 0 | # Temporary holding place for |
= | r13 | 0 | # Loop counter |
#Print out first two Fibonacci numbers (initial values of r10 & r11) eval r10
eval r11
#Calculate and print the rest of the numbers. The last line has the
#stopping value of the loop index. (This is a simple counting loop.) loop:
eval +r11 | # “+” makes an expression: decimal and hex printing | |
= r12 | r11 | # Compute n’th Fibonacci term |
= r11 | r11+r10 |
|
= r10 | r12 |
|
= r13 | r13+1 | # Increment loop counter |
if r13<0d50 goto loop | # Loop again? |
Figure 9-1. An Example Command File to Compute Fibonacci Numbers
9.5Summary of Command File Commands
. filename
Executes commands in the given command file. The file is opened and its contents are executed as if they were entered from the keyboard. When the contents of a
if
if
In the first form, causes the rest of the line to be ignored if
The if command may be executed from the keyboard. In combination with xski’s Command History (see Section 3.7.1, “The xski Main Window”) or ski’s command repetition mechanism (see Section 3.7.2, “The ski Command Window”), this can be quite powerful.
goto label
In a command file (only), causes execution to continue following the first line in the file which contains the label. Goto’s may be forward or backward.
#comment
The “ #” and all characters following it until the next newline are ignored.
label:
The colon (“ :”) command marks a goto label. All characters following the “ :” and preceding the next newline are ignored.
Copyright © 2000 | Command Files |