beautypg.com

A jump commands, E-115 – Casio fx-5800P User Manual

Page 116

background image

E-115

Note

These commands evaluate the expressions on either side, and return 1 if
true and 0 if false.

A Jump Commands

Goto ~ Lbl

Syntax Goto

n

: .... : Lbl

n

or Lbl

n

: .... : Goto

n

(

n

is an integer from 0 to 9, or a

variable name from A through Z.)

Function

Execution of Goto

n

jumps to corresponding Lbl

n

.

Example ?

→ A : Lbl 1 : ? → B : A × B ÷ 2 ^ Goto 1

Important!

A Go ERROR occurs if there is no corresponding Lbl

n

in the same program

where Goto

n

is located.

Dsz (Decrement and Skip on Zero)

Syntax

Dsz : : : ...

Function

Decrements the value of by one. Then if the value
is non-zero, is executed, followed by and
everything after it in succession. If the value is zero, 1> is skipped, and and everything after it is executed.

Example 10

→ A : 0 → C : Lbl 1 : ? → B : B + C → C : Dsz A : Goto 1 : C ÷ 10

Isz (Increment and Skip on Zero)

Syntax

Isz : : : ...

Function

Increments the value of by one. Then if the value
is non-zero, is executed, followed by and
everything after it in succession. If the value is zero, 1> is skipped, and and everything after it is executed.

S

Syntax

1 S :

: ...

2 S : : ...

Function

This is a conditional branching command. Conditional branching command
used in combination with relational operators (=,

≠ , >, >, <, <).

Syntax

1: is executed if the condition to the left of the S

command is true, and then and everything after it is executed
in sequence. is skipped if the condition to the left of the
S command is false, and then and everything after it is
executed.

Syntax

2: A non-zero evaluation result of the condition to the left of the S

command is interpreted as “true”, so is executed, followed
by and everything after it in succession. A zero evaluation
result of the condition to the left of the

S command is interpreted as “false”,

so is skipped, and and everything after it is
executed.