Please put all of your .data and .space declarations at the beginning of the program. It makes the code much more readable!
Always use LDCH and STCH when dealing with buffers for characters. The keyboard interrupt will pack the characters in a way that requires
use of LDCH to succesfully extract all the characters.
push any registers with useful content
push parameter values in reverse order
CALL function
ADD SP, total size of parameters pushed
pop to recover any saved registers
PUSH FP save callers frame pointer
LOAD FP, SP set up own frame pointer
SUB SP, total size of local variables
Nth parameter is at FP+(N+1)
Nth local is at FP-N
put result if any in R1 //Doesn't have to be R1, but be consistent
LOAD SP, FP get rid of all local variables
POP FP recover callers frame pointer
RET