refactored and simplified MSIZE-OBJECT, MWRITE-OBJECT and MREAD-OBJECT