Added code for all flash routines, next steps are (D,X) and (P,X) -> D is easier

Signed-off-by: Ian bell <ian.h.bell@gmail.com>