You would do an if on ground check. So when not on ground and .. use a variable to tell if you are going up or down or... say if i am not on ground and not pressing jump.
Code:
LDA Object_physics_byte,x
AND #%00000001 ;; is it on the ground?
;;your stuff here too