Datasheet

BRANCH INSTRUCTIONS
INSTRUCTION SYNTAX FUNCTION EXAMPLE 16-BIT ASSEMBLED
BIT SEQUENCE
ASSEMBLED
CODE HEX
rst Resets program
counter and start the
program again.
rst 0000 0000 0000 0000 0000
branch loopcount, address Repeat a section of
code.
branch 20, loop1 1010 1010 0000 0000 AA00
Loopcount is a constant (0 to
63);
; define loop for 20 times Assumed that loop1
points to addr 00h.
Address is a label which
specifies the offset.
branch var1, address Repeat a section of
code.
ld ra, 20 1000 0110 0000 0000 8600
Var1 is a variable (ra, rb, rc, rd); branch ra, loop1 Assumed that loop1
points to addr 00h.
Address is a label which
specifies the offset.
; define loop for 20 times
int Causes an interrupt. int 1100 0100 0000 0000 C400
end interrupt, reset End program
execution.
end i 1101 0000 0000 0000 D000
Interrupt (i) is an optional flag.
Reset (r) is an optional flag.
; End program execution and
send an interrupt.
trigger w{source1|
source2...}
Wait a trigger. trigger w{1} 1110 0000 1000 0000 E080
Source is the source of the
trigger (1, 2, 3, e).
;Wait a
trigger from the engine 1.
trigger s{target1|target2...} Send a trigger. trigger s{1} 1110 0000 0000 0010 E002
Target is the target of the
trigger (1, 2, 3, e).
;Send a
trigger to the engine 1.
jne var1, var2, address Jump if not equal. jne ra, rb, flash 1000 1000 0010 0001 8821
Var1 is a variable (ra, rb, rc, rd); ;Jump to flash if A != B. Assumed that offset =
2.
Var2 is a variable (ra, rb, rc, rd);
Address is a label which
specifies the offset.
jl var1, var2, address Jump if less. jl ra, rb, flash 1000 1010 0001 0001 8A11
Var1 is a variable (ra, rb, rc, rd); ;Jump to flash if A < B. Assumed that offset =
1
Var2 is a variable (ra, rb, rc, rd);
Address is a label which
specifies the offset.
jge var1, var2, address Jump if greater or
equal.
jge ra, rb, flash 1000 1100 0001 0001 8C11
Var1 is a variable (ra, rb, rc, rd); ;Jump to flash if A >= B. Assumed that offset =
1.
Var2 is a variable (ra, rb, rc, rd);
Address is a label which
specifies the offset.
je var1, var2, address Jump if equal. je ra, rb, flash 1000 1110 0001 0001 8E11
Var1 is a variable (ra, rb, rc, rd); ;Jump to flash if A = B. Assumed that offset =
1.
Var2 is a variable (ra, rb, rc, rd);
Address is a label which
specifies the offset.
DATA TRANSFER AND ARITHMETIC INSTRUCTIONS
AN-2227 - LP5523 Evaluation Kit
16 Copyright © 1999-2012, Texas Instruments Incorporated