LOCC and SKPC Instructions

Purpose:To find a character or skip characters in a character string
Format:opcode char.rb, len.rw, addr.ab
Operation:
R0 <- len;
R1 <- addr;
LOCC
while { R0 > 0 AND (R1) NEQ char}
R0 <- R0 - 1;
R1 <- R1 + 1;
SKPC
while { R0 > 0 AND (R1) EQU char}
R0 <- R0 - 1;
R1 <- R1 + 1;
Condition
Codes:
N <- 0;
Z <- R0 EQL 0;
V <- 0;
C <- 0;
Exceptions:None
Opcodes:
3ALOCCLocate Character
3BSKPCSkip Character
Description: The character operand is compared with the bytes of the string specified by the length operand and the address operand. Comparison continues until equality is detected for the LOCC instruction or inequality for the SKPC instruction or until all bytes of the string have been compared. If equality is detected for the LOCC instruction, the condition code Z is cleared, otherwise it is set. If inequality is detected for the SKPC instruction, the condition code Z is cleared, otherwise it is set.
Notes:
After execution:
R0 = number of bytes remaining in the string (including the located one if it was located). otherwise R0 <- 0.
R1 = address of the byte located, if located; otherwise R1 = address of one byte beyond the end of the string.