The MASM Forum Archive 2004 to 2012

Project Support Forums => HLA Forum => Topic started by: Randall Hyde on February 08, 2008, 08:30:48 PM

Title: Minor change to str.substr/str.a_substr
Post by: Randall Hyde on February 08, 2008, 08:30:48 PM
Hi All,

I've just made a minor change to the str.substr and str.a_substr functions. If the substring they produce is truncated because the sum of index+len (arguments to substr) is greater than the length of the string passed as an argument, the function will return with the carry flag clear. In all other (non-exception) cases, the carry flag comes back clear.

I've also modified the "returns" string to be "@c" for both of these functions. Note that str.a_substr previously has a "returns" value of "eax". This will break any code that used the "returns" value.  However, this is probably quite rare for this particular function. If there are a large number of complaints, I might consider switching the "returns" value for str.a_substr back to "eax".
hLater,
Randy Hyde

Title: Re: Minor change to str.substr/str.a_substr
Post by: Randall Hyde on February 08, 2008, 09:29:27 PM
Quick note: the change with respect to the @c returns value applies to the str.first, str.last, and str.truncate string function families, too.
hLater,
Randy Hyde