macros for convinient port manipulations