Make the len parameter optional in STRSUB(str, pos, len)

An unspecified length will continue to the end of the string.
This commit is contained in:
Rangi
2021-04-19 12:00:42 -04:00
committed by Eldred Habert
parent b1e6c73197
commit dc5b7802c8
5 changed files with 67 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
SECTION "sec", ROM0
xstrsub: MACRO
PRINTLN STRSUB(\1, \2, \3)
PRINTLN STRSUB(\#)
ENDM
xstrsub "ABC", 1, 1
@@ -10,12 +10,17 @@ ENDM
xstrsub "ABC", -2, 1
xstrsub "ABC", -1, 1
xstrsub "ABC", 0, 1
xstrsub "ABC", 2
xstrsub "ABC", -1
xstrsub "ABC", 5
xstrsub "ABC", -5
xstrsub "ABC", 1, 2
xstrsub "ABC", 2, 2
xstrsub "ABC", 2, 32
xstrsub "ABC", 2, 300
xstrsub "ABC", -3, 300
xstrsub "ABC", 4, 0
xstrsub "ABC", 5, 0
xstrsub "ABC", 4, 1
xstrsub "カタカナ", 1, 2
xstrsub "カタカナ", 3, 2