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 and simpler _strleft routine with instruction time comparison table between clr.b (An) and cmp.b #0,(An) #126
====
; for testing purposes in easy68K program
; lea string1,A0
; lea string2,A1
; moveq #1,d0
; Notepad _leftstr source is included with proper tabulation since Github messes this up?
MOVE.L A1,A3
_leftstr:
SUBQ.L #1,D0 :substract 1 from bytes to copy
BGE.B StringLeftCopy :branch when greater or equal than 0 (0 = 1 byte to copy)
CLR.B (A1) :on 68040 and 68060 CPU's move.b #0,(An) is faster than clr.b so use of it is debatable
MOVE.L A3,A0
RTS
StringLeftCopy:
MOVE.B (A0)+,(A1)+
TST.B (A0) ;CMP.B #nn,(An)= a lot slower, see table below
BEQ.S StringLeftDone
SUBQ.L #1,D0 :next char
BGT.S StringLeftCopy :#chars to copy >0 copy next byte
StringLeftDone:
CLR.B (A1) :on 68040 and 68060 CPU's move.b #0,(An) is faster than clr.b so use of it is debatable
MOVE.L A3,A0
RTS
;Comparison between TST.B (An) and CMP.B (An) for all 68K CPU's
changed the title [-]Faster and simpler _strleft routine with instruction time comparison table between clr.b (An) and cmpi.b #0,(An)[/-][+]Faster and simpler _strleft routine with instruction time comparison table between clr.b (An) and cmp.b #0,(An)[/+]on May 15, 2026
Activity
[-]Faster and simpler _strleft routine with instruction time comparison table between clr.b (An) and cmpi.b #0,(An)[/-][+]Faster and simpler _strleft routine with instruction time comparison table between clr.b (An) and cmp.b #0,(An)[/+]