browser

starts.xyw

starts.xyw
calendarsave
; UNTESTED
; Pushes $01 if s1 starts with s2, $00 otherwise 
; s1 s2 -> f
.label starts
   POPyw ; save fragment 
   POPxw ; save string 
   .label starts.loop
     ; if fragment reached end, then we are good 
     LDByw $00 EQU starts.ok JCNw
     ; otherwise if chars don't match, fail
     LDBxyw NEQ starts.fail JCNw
     ; if they match, increment and keep testing 
     INCxyw starts.loop JMPw
   .label starts.ok
     $01 RTS
   .label starts.fail
     $00 RTS