STRSUB and CHARSUB allow zero or negative positions

These are offsets from the end of the string, as if the
STRLEN or CHARLEN respectively were added to the position.

Fixes #812
This commit is contained in:
Rangi
2021-04-18 21:40:38 -04:00
committed by Eldred Habert
parent 459773b3f0
commit b1e6c73197
6 changed files with 35 additions and 23 deletions

View File

@@ -7,11 +7,14 @@ ENDM
xstrsub "ABC", 1, 1
xstrsub "ABC", 2, 1
xstrsub "ABC", 3, 1
xstrsub "ABC", -2, 1
xstrsub "ABC", -1, 1
xstrsub "ABC", 0, 1
xstrsub "ABC", 1, 2
xstrsub "ABC", 2, 2
xstrsub "ABC", 2, 32
xstrsub "ABC", 2, 300
xstrsub "ABC", 0, 300
xstrsub "ABC", -3, 300
xstrsub "ABC", 4, 0
xstrsub "ABC", 4, 1
xstrsub "カタカナ", 1, 2