Scan to Delimiter - Equal (SDE)/OP=16

Format

OP AF BF A Syllable B Syllable

OP = 16

AF is the length of the A field. A value of 00 is equal to a length of 100 units (digits or characters as specified by the A address controller). AF may be indirect or may indicate that the A syllable is a literal.
BF is the length of the B field. A value of 00 is equal to a length of 100 units (digits or characters as specified by the B address controller). BF may be indirect.

The A Syllable is the address of the delimiter list field. Address may be indexed, indirect or extended. The final address controller data type may be UN, SN or UA. An SN controller is treated as if it were a UN controller (i.e. 7SN == 7UN).
The B Syllable is the address of the data field to be scanned. Address may be indexed, indirect or extended. The final address controller data type may be UN, SN or UA. An SN controller is treated as if it were a UN controller (i.e. 7SN == 7UN).

Function

The Scan to Delimiter - Equal instruction scans the B field for a character equal to one of the delimiter characters from the A field.

The first B field character is compared to each delimiter (A) field character until a match is found. If no match is found, the next B field character is compared to each delimiter. Continue this process until a matching delimiter is found or until the B field is exhausted.

If a numeric data type (UN/SN) is specified in either field add the EBCDIC zone digit F to each digit to form the character for use in the comparison.

This instruction stores the number of characters in the B data field preceeding the equal character into memory locations 38-39, relative to Base #0 (accessible with indirect field length). However, if no equal character is found, store the field length of the data field minus one (BF - 1).

Comparison Flags

Set the Comparison Flags to HIGH if no characters in the B field were found to be equal to any delimiter in the A field. Set the Comparison Flags to LOW if the first character in the B field was equal to any delimiter and set the Comparison Flags to EQUAL if any character but the first was equal to any delimiter.

Overlap

There are no overlap restrictions for this instruction.

Examples

Example (1) Scan Delimiter-Equal, First digit equal

OP AFBF A Syllable B Syllable
16 0104 A Field (UN) B Field (UA)
                    BEFORE              AFTER
   A Field             1              unchanged
   B Field         F1C8C4D9           unchanged
   000038             nn                  00
   Comparison Flags   nn                 LOW

Example (2) Scan Delimiter-Equal, Other than first digit equal

OP AFBF A Syllable B Syllable
16 0104 A Field (UA) B Field (UA)
                    BEFORE              AFTER
   A Field            E7              unchanged
   B Field         C1C2E7F5           unchanged
   000038             nn                  02
   Comparison Flags   nn                 EQUAL
instructions/sde.txt · Last modified: 2008/11/25 11:53 by scott
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki