pushbutton does not work?

The following code run 2 stepper motors, when I tested, two problems happened,

  1. Push button didn't work
  2. 2 stepper motors only ran one direction.

Could you check the code for me, thanks!!!

#define EN        8       
#define X_DIR     3       
#define X_STP     2       
#define Y_DIR     5     
#define Y_STP     4      
int pushbuttonpin = 7;          
int val = 0;                  

void step(boolean dir, byte dirPin, byte stepperPin, int steps)
{
Serial.begin(9600);
  val = digitalRead(pushbuttonpin);   //Read push button switch pin status
   if (val == HIGH)
  
  digitalWrite(dirPin, dir);
  delay(50);
  for (int i = 0; i < steps; i++) {
    digitalWrite(stepperPin, HIGH);
    delayMicroseconds(800);  
    digitalWrite(stepperPin, LOW);
    delayMicroseconds(800);  
  }
}
void setup()
{
  pinMode(X_DIR, OUTPUT); pinMode(X_STP, OUTPUT);
  pinMode(Y_DIR, OUTPUT); pinMode(Y_STP, OUTPUT);
  pinMode(EN, OUTPUT);
  digitalWrite(EN, LOW);
}
void loop(){
  step(false, X_DIR, X_STP, 2000); 
  step(false, Y_DIR, Y_STP, 2000); 
  delay(1000);
  step(true, X_DIR, X_STP, 2000); 
  step(true, Y_DIR, Y_STP, 2000); 
  delay(1000);
}
  1. Push button didn't work

What should happen ?
What does happen ?
How is the input wired ?

void step(boolean dir, byte dirPin, byte stepperPin, int steps)
{
  Serial.begin(9600);
  val = digitalRead(pushbuttonpin);   //Read push button switch pin status
  if (val == HIGH)
    digitalWrite(dirPin, dir);
  delay(50);
  for (int i = 0; i < steps; i++)
  {
    digitalWrite(stepperPin, HIGH);
    delayMicroseconds(800);
    digitalWrite(stepperPin, LOW);
    delayMicroseconds(800);
  }
}

Which lines of code should be executed if val is HIGH when tested ?
Note that I have Auto Formatted your code to make it clearer