Before anything else, I would recommend that you put address labels on their own line, because doing that makes the code easier to read. Also, I recommend using more descriptive labels.
Example:
decrement_loop:
sub cx,1
jz mylabel
There's several things that you could do better with your program.
1) You had better add input checking code. DOS function 1 has a quirk to it. If the user enters a keystroke that is not an ASCII character, then the function returns 0 in AL. The next call to function 1 will return the pseudo-scan code of the key that was pressed. So, always check to see if AL=0. If so, then notify the user with an error message and call DOS function 1 again in order to get rid of the pseudo-scan code byte before getting input again from the user. By the way, function 1 only gets a single keystroke at a time, so I'm assuming that the user will only input a single digit number.
2) Add a check to see if the user actually entered a digit between 0-9. The ASCII numbers for 0-9 is 48-57 (decimal). So, subtract 48 from AL and jump to error handling code if the number is greater than 9. If no error, then store the number in the array. By the way, don't use the AAA instruction; Subtract by 48 instead.
3) Your input loop is a complete mess and incorrect. After getting valid input, put the byte in an array and then repeat the input loop 4 more times. (It is more efficient to use only 1 loop and not use an array, but the instructions say to use an array, therefore you need 2 loops.) After that, you should check for prime numbers within the array by using another loop. The 4 single digit prime numbers are 2, 3, 5, and 7.
I don't even want to decipher your code because you're making the CPU jump all over the place. It's about as bad as some stupid high level programmer who writes too many unnecessary procedures. (That covers almost every programmer these days!)
I don't want to do your homework for you, so here's the general idea (using the MASM assembler) with some code left out:
.data ;program data
myarray db 5 dup (?) ;allocate 5 byte uninitialized array
.code ;program code starts here
mov si, offset myarray ;use SI to point to start of myarray
mov cx,5 ;input loop counter
input_loop:
mov ah,1
int 21h
(check AL for 0, jump to error code if it so)
sub al,48
(jump to error code if AL > 9)
mov byte ptr [si],al ;save AL in array
inc si ;increment array pointer
dec cx ;decrement loop counter
jnz input_loop ;if CX is not 0, jump back to input_loop
;at this point, the input loop is done
mov cx,5 ;CX is our loop counter again
mov si, offset myarray ;set SI to start of myarray
prime_loop:
mov al,byte ptr ds:[si] ;put byte from myarray into AL
cmp al,2
je primenumber ;jump if it's a prime number
(check for other numbers)
inc si ;increment myarray pointer ;execution continues here if no prime number
dec cx ;decrement counter
jnz prime_loop
(end program)
primenumber:
add al,48 ;convert AL into ASCII number
(print value in AL)
inc si ;increment myarray pointer
dec cx ;decrement loop counter
jnz prime_loop
(code for ending program, or jump to code that ends program)
(I didn't make the 'primenumber' code into a procedure because my code is more efficient.)