Compare Null-Terminated Strings (STRCMPNULL)

Instruction Syntax

Bound Program Access
Built-in number for STRCMPNULL is 18.
STRCMPNULL (                                                                    
            null_terminated_string1   : address of aggregate(*)                 
            null_terminated_string2   : address of aggregate(*)                 
) :   signed binary(4) value which indicates if null_terminated_string1 is         
      lexically less than (-1), equal to (0) or greater than (1)                
      null_terminated_string2                                                   

Description:

A compare is done of the storage specified by null terminated string1 and null terminated string2. If the first byte of null terminated string1 is less than the first byte of null terminated string2, the function returns -1; if the byte is greater the function returns 1. If the bytes are equal the function continues with the next byte. This process is repeated until either:

  • The end of null terminated string1 (ie. a null character) and null terminated string2 is reached. The function returns 0.
  • The end of null terminated string1 is reached. The function returns -1.
  • The end of null terminated string2 is reached. The function returns 1.

Both strings must contain a null character. Otherwise, the results are undefined.

Authorization Required

  • None

Lock Enforcement

  • None

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation