You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Faster _strlen routine: bonus is that it is fully 32 bit compliant. inputstring A2, output length D0 = 32 bit value #124
Adding txt file of routine since Github does not like my formatting??? See below for attachment.
Assuming register A2 as the source register as per string.s, returning length in register D0
Fastest byte string lenght routine using post-increment and initial string address to compute length returned in register D0
_strlenn
MOVE.L A2,D0 ;lsave the startaddress of our string into register D0 ;
StringsizeLoop: ; our test .loop label, take notice of the ":" at the end
TST.B (A2)+ ; test character A2 points to + post-increment the address pointer to next character
BNE.S StringsizeLoop ; is character not equal to 0, check next (remember, it is c-style Null terminated)
SUB. L D0,A2 ; we found end of c-style string terminator, so substact the start from the end
MOVE.l A2,D0 ;move the result to data register d0 for returning the value
SUBQ.L #1,d0 ; substract 1 from the result since it points to the C-style Null-terminator!
RTS
Activity