In firmware 2.03 and earlier, when you create axes the endstop inputs are allocated automatically. So if you create axes U and V in your M584 command then U will use the E0 input and V will use the E1 input.
In firmware 3.0 beta you have to allocate endstops for additional axes and specify the input pins using M574.