Factor out evalasm() function