Encoder driver stepper motor, not work Arduino DUE - HELP!

Now I was able to customize the output pin on the right to DUE. Now it's work, but still we do not act quickly, the problem is not on the Arduino boards, but the program (code).
Also on the Arduino DUE signal from the encoder to move quickly lose signal and a stepper motor works slowly.
new code:

#define encoder_a 22 
#define encoder_b 23 
#define motor_step 53 
#define motor_direction 52 

volatile long motor_position, encoder;

void setup () {
   pinMode(motor_step, OUTPUT);
  pinMode(motor_direction, OUTPUT);
  
  pinMode(encoder_a, INPUT);
  pinMode(encoder_b, INPUT);
  digitalWrite(encoder_a, HIGH); 
  digitalWrite(encoder_b, HIGH); 
  
  attachInterrupt(22, encoderPinChangeA, CHANGE);
  attachInterrupt(23, encoderPinChangeB, CHANGE);
  encoder = 0; //reseet the encoder position to 0
}

void loop() {
  if (encoder > 0) {
    digitalWrite(motor_direction, HIGH);
    digitalWrite(motor_step, HIGH);
    digitalWrite(motor_step, LOW);
    delayMicroseconds(600); 
    motor_position++;
    encoder = 0; //encoder--;
  }
  else if (encoder < 0) {
    digitalWrite (motor_direction, LOW); 
    digitalWrite (motor_step, HIGH);
    digitalWrite (motor_step, LOW);
    delayMicroseconds(600); 
    motor_position--;
    encoder = 0; //encoder++;
  }
}

void encoderPinChangeA() {
  if (digitalRead(encoder_a)==digitalRead(encoder_b)) {
    encoder--;
  }
  else{
      encoder++;
  }
}

void encoderPinChangeB() {
  if (digitalRead(encoder_a) != digitalRead(encoder_b)) {
    encoder--;
  }
  else {
    encoder++;
  }
 }