break out string scanning to a separate function to prep for ASMing it