13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Assembly Language.DEFINE ID "@STRCAT('TAS','KING')" ; ID = '<strong>TASKING</strong>'@STRCMP(string1,string2)Compares string1 with string2 by comparing the characters in the string.The function returns the differencebetween the characters at the first position where they disagree, or zero when the strings are equal:0 if string1 > string2Example:.IF (@STRCMP(STR,'MAIN'))==0 ; does STR equal 'MAIN'?@STRLEN(string)Returns the length of string as an integer.Example:SLEN .SET @STRLEN('string') ; SLEN = 6@STRPOS(string1,string2[,start])Returns the position of string2 in string1 as an integer. If string2 does not occur in string1, the last stringposition + 1 is returned.With start you can specify the starting position of the search. If you do not specify start, the search isstarted from the beginning of string1.Example:ID .set @STRPOS('<strong>TASKING</strong>','ASK') ; ID = 1ID .set @STRPOS('<strong>TASKING</strong>','BUG') ; ID = 7@STRSUB(string,expression1,expression2)Returns the substring from string as a string. expression1 is the starting position within string, andexpression2 is the length of the desired string. The assembler issues an error if either expression1 orexpression2 exceeds the length of string. Note that the first position in a string is position 0.Example:.DEFINE ID "@STRSUB('<strong>TASKING</strong>',3,4)" ;ID = 'KING'95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!