Atmega328p assembly code question!

HI,
I am a newbie to assembly language, so basically I have a push button connected with a 7-segment display.

Question:
I want to store short presses on the push button (20ms) as a binary value of 0 and long presses(20ms>x<100ms) as binary value of 1?

And also I want the user to be limited to 4 presses?

Thanks in advance
Ankit

PS sorry about my bad english not my first language :slight_smile:

Why can you not use C++ ?

i'm trying to do it in assembly langugae.

Your question has to do with program logic, not language detail. Limiting the user to 4 presses is done using the same algorithms in assembly, C++, Java and Turing. What you want to know is, how to code it in assembler. But short of guiding you through the stages of design and code translation, an answer would begin to resemble a complete working example. Nobody here has time to do that for you, for free. You have to design the high level logic, learn the opcodes, and "connect the dots".