I think you've got the variable declarations backwards.
Try myport.0 = porta.0, etc. instead of the way you have it.