Adding and subtracting a value inside EEPROM

so, i want to make so that whenever a value is added/subtracted, it saves the value in EEPROM, so when i turn the arduino off and on again, it shows the same value.

the add button is fine, i added the value and turned off the arduino and it still shows the same. but when i subtract it (more than 255) and turned it off and on, it add 1 to the value (it probably doesnt reach 0? this happends after i turned it off and on).
i've tried to change the numbers a little bit...

#include <EEPROM.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(18, 19, 20, 21, 22, 23);

int value = EEPROM.read(0);
int a = EEPROM.read(4); // the variable to count the loops "value" has made

int add_button = 27;
int minus_button = 26;

void setup() {
  lcd.begin(16,2);

  pinMode(add_button, INPUT);
  pinMode(minus_button, INPUT);
}

void loop() {
  if(digitalRead(add_button) == HIGH)
  {
    value = value + 125; // add them by 250 (the delay is too short)
    EEPROM.write(0, value); // save the value
    lcd.clear();
    delay(50);
  }

  if(digitalRead(minus_button) == HIGH)
  {
    value = value - 125; // subtract them by 250
    EEPROM.write(0, value); // save the value
    lcd.clear();
    delay(50);
  }

  if(value >= 255) // this is when the add button is pressed
  {
    value = value - 255; // loop value to 0
    a++; // add the loop count
    EEPROM.write(4, a); // save a
  }

// the problem opening
  if(value <= 0)  // this is when the subtract button is pressed and it subtracts more than 255
  {
    value = value + 255; // loop to 255
    a--; // subtract the loop count
    EEPROM.write(4, a); // save a
  }
// the problem closing

  if(a >= 255)
  {
    a = a - 255; // a is 255 when starting the program (EEPROM default) and that affects the display algorithm below
  }

  lcd.setCursor(0,0);
  lcd.print(value + (a * 255) - 5); // -5 because it displays 255 when starting the program (EEPROM default), i hope you understand what im doing here
}

looking at the problem, changing "if(value <= -1)" wont change anything
"if(value <= 1)" broke the display
"value = value + 256" with "if(value <= -1)" wont work, "value = value + 254" wont work either.
how do i solve this problem?

Do you know that EEPROM.read() and EEPROM.write() work with byte values in the range 0..255 and that an EEPROM location that has never been written to will contain 255? See https://docs.arduino.cc/learn/built-in-libraries/eeprom/

There is no such condition in your code.
Did you actually use another code than ones showing in the topic?

this will not work, but this:

#include <EEPROM.h>
int value;
int a;

void setup(){
  value = EEPROM.read(0);
  a = EEPROM.read(4);
}
#include <EEPROM.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(18, 19, 20, 21, 22, 23);
const byte add_button = 27;
const byte minus_button = 26;

int value;
int a;

void setup() {
  EEPROM.get(0, value);
  EEPROM.get(4, a);

  lcd.begin(16, 2);

  pinMode(add_button, INPUT);// probably pulled down, if not - use INPUT_PULLUP
  pinMode(minus_button, INPUT);// probably pulled down, if not - use INPUT_PULLUP
}

void loop() {
  static int oldVal = value;

  if (digitalRead(add_button))
  {
    value = value + 1; // add
    LP();
    delay(50);
  }

  if (digitalRead(minus_button))
  {
    value = value - 1; // subtract
    LP();
    delay(50);
  }

  if (value != oldVal) 
  {
    oldVal = value ; 
    EEPROM.put(0, value);
    a++; // add the loop count
    EEPROM.put(4, a); // save a
    LP();
  }
}

void LP() {
  lcd.setCursor(0, 0);
  lcd.print(value);
  lcd.print("  ");
  lcd.setCursor(0, 1);
  lcd.print(a);
}

Which Arduino?

yeah, i only change the names and add some comments

if i understand this right, an atmega32 connected to an arduino uno r3, sorry that i didnt specify it

this code adds a whenever i add or subtract value. i think the post is not understandable enough... atleast, thanks for the effort!

i didnt know this, i tried too change write and read to put and get and it works without the variable a! its litterally just a simple code now, thank you so much for telling me!