Updated to use macros for io/out lo/hi