=> R0 = number of characters to skip (n),
or -1 to move to the end of the string - find its length
R1 = pointer to the input string (terminated by 0,2)
R2 = current foreground colour
R3 = current background colour
R4 = current font substyle
<= R0 = · If the n'th character is in the string then this points to the end of the n'th character (start in R1)
· If the n'th 'character' is the terminator (0,2) then this equals R1 (start of the terminator)
· If it reached the string terminator before the n'th character then this is R1-number of chars not skipped
R1 = start of the next printable character after skipping n
(or string terminator if reached that first).
R2-R4 updated by any colour/substyle change control codes.
This SWI takes as input a line of the format required by r_data (ie
containing control sequences starting with 0) and a number 'n'
and returns the start of the (n+1)'th printable character within this line
(ie it skips over n printable characters), ignoring control codes. Thus on
exit it points to a byte 1-255 or one of the control sequences 0,0 or 0,2 or
0,3,l,h or 0,4,f,b,c1,c2 each of which define one printable character. If the
offset n is off the end of the line then it will point to the 0,2 terminator.
It also keeps track of the colour changes that take place.
NB If n=0 then it may still be useful as it will jump over any colour
changes before the first character. If R0 > R1 on exit then the character was
found, otherwise there were R1 - R0 characters left to skip.
Eg: Input: "hello ",0,1,2,3,"goodbye",0,2
Output: If n = 0 then it will point to the 'h'
If n = 6 then it will point to the 'g'
If n = 100 then it will point to the 0 of 0,2.
|
|
|