constants for errors, extract command type from destination

it is clearer to use predefined error codes for return values.
the command type (MS/MM/BC) can easily be extracted from the destination address