first approx of a lexer function (spec for the to-be-written assembly routine)