You can save nine bytes by eliminating JNZ IORD, JZ INCREMENT and JZ 0820H. The OUT A0H instruction should have the 0820H tag preceding it.
Both CPI instructions could take a long time to attain, and cause a false system freeze or loop activity. This is a good program, just needs clarity on each subroutine. The loops created by the OUT and JMP could only be stopped by resetting the CPU.
Doesn't anyone use pseudo code anymore to break a simple problem like this down and eventually substitute the pseudo statement with real mnemonics.
count=0
1. if count equal to 255 goto 3
2. if button up pressed then count=count+1
3. if count equal to zero goto 1
4. if button down pressed then count=count-1
5. goto 1
or something along these lines...Use a time delay to prevent switch debounce if required or another way to prevent the count up/down buttons being held
It's assembler so jmps/gotos are allowed.