CY325 ETC, CY325 Datasheet - Page 34

no-image

CY325

Manufacturer Part Number
CY325
Description
Stepper System Controller
Manufacturer
ETC
Datasheet
Several CY545 commands control program branching and flow while the CY545 is executing a
program from external memory. These commands normally are used only within a program, not
as direct CY545 commands. The CY545 will however execute the commands in the direct
mode, but the result may be different than if the commands were run from a program. The
commands are:
In addition to the above commands, the Y command, when executed from a program, provides
a 16 bit jump that can reach any address of the external memory.
The above listed commands all use an 8 bit address value. This restricts the range of addresses
to the 256 bytes of the current memory page. When a jump is taken, the lower byte of the
current address pointer is replaced by the 8-bit address parameter value, and program
execution continues at this new 16-bit address. If one of the above commands lies on a page
boundary, the address pointer is incremented before the command is executed, so the branch
would be taken into the new page of the memory, not the previous page that started the
command.
The Jump command simply provides a short version of the branch function. It can reach any
address on the current memory page.
The Loop command provides a repeated branch, with a specified number of iterations. Both
parameters are byte values, so a loop may be repeated 255 times, and the branch must be to
an address on the current page.
The Zloop command also provides a repeated branch. However, the repeat count is a 16-bit
value, so the Zloop may be repeated up to 65535 times. The branch is still restricted to an
address on the current page.
For both loop commands, the instruction following the loop is executed when the loop count is
exhausted.
The combination of the Loop and Zloop commands provides two levels of nesting to loops. Only
one of each type of loop may be active at a time. That is, a number of loops may reside within
one zloop, or a number of zloops may reside within one loop.
However, one loop may not reside within another loop, and one zloop may not reside within
another zloop. This is shown below:
© 2002 Cybernetic Micro Systems
J Addr
L Cnt,Addr
Z Cnt16,Addr
C
C
C
H
H
H
A
A
A
P
P
P
T
T
T
E
E
E
R
R
R
8
8
8
Jump to byte location of current page
Loop to byte address for count times
Zloop to byte address for count times
-
-
-
P
P
P
R
R
R
O
O
O
Jump and Loop
G
G
G
Nested Loops
R
R
R
A
A
A
M
M
M
29
B
B
B
R
R
R
A
A
A
N
N
N
Chapter 8 - Program Branch Commands
C
C
C
H
H
H
C
C
C
O
O
O
www.ControlChips.com
M
M
M
M
M
M
A
A
A
N
N
N
D
D
D
S
S
S

Related parts for CY325