QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools


UT_CSTR/UT_CSTR - Vector $E6

This vector compares two strings.

Call ParametersReturn Parameters
D0.BComparison type.D0.L-1, 0 or +1
A0.LPointer to string 0.A0.LPreserved.
A1.LPointer to string 1.A1.LPreserved.
A6.LBase address.A6.LPreserved.


No errors are returned by this vector call.


  • All registers not shown above are not used on entry and are preserved on exit.
  • The addresses in A0 and A1 are relative to A6.L.
  • The strings are compared and the result recorded in D0.L. If string 0 < string 1 the result is -1. If the strings are the same the result is 0. Otherwise the result is +1.
  • There are four types of comparison obtained by setting one of 0 to 3 in D0.B. The types are given below.
  • The comparison is carried out given a specific order of characters.
    • SPACE !"#$%'()*+,-/:;⇔?@[\]^_£{|}~Copyright.
    • 0123456789
    • AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz
    • other non printing characters in ASCII order
  • The order of the first line is nearly ASCII except that the full stop comes at the end.

Type of Comparison

0Characters are compared directly
1The case of characters is ignored
2Embedded numbers are taken into account (see below)
3A combination of types 1 and 2
Embedded Number

An embedded number is a set of numerical digits possibly containing a decimal point. In the case of types 2 and 3, embedded numbers are sorted by their value not character by character. This means that "Lim4_asm" would come before "Lim10_asm".

qdosmsq/vectors/cstr.txt · Last modified: 2010/11/08 14:32 by george.gwilt