Question: I need help finishing this program, I am coding this in pep / 9 assembly language. The output that his program is suppose to give

I need help finishing this program, I am coding this in pep/9 assembly language. The output that his program is suppose to give is the user inputs letters of A, B, and C. The program has to remember how many times the user inputs the letter. To end the program, I used the letter X to quit it. I am stuck on trying to make the loop work. This is what I have done so far and I don't know what I am missing.
BR main
countA: .WORD 0
countB: .WORD 0
countC: .WORD 0
letter: .WORD 0
msg: .ASCII "Enter a letter A, B, C or X to quit: \x00"
msgA: .ASCII "Number of A's: \x00"
msgB: .ASCII "Number of B's: \x00"
msgC: .ASCII "Number of C's: \x00"
main: STRO msg,d
DECI letter,d
loop: LDWA letter,d
CPWA 'X',i
BREQ done
CPWA 'A',i
BREQ NOA
CPWA 'B',i
BREQ NOB
CPWA 'C',i
BREQ NOC
STRO msg,d
DECI letter,d
BR loop
NOA: LDWA countA,d
ADDA 1,i
STWA countA,d
STRO msg,d
DECI letter,d
BR loop
NOB: LDWA countB,d
ADDA 1,i
STWA countB,d
STRO msg,d
DECI letter,d
BR loop
NOC: LDWA countC,d
ADDA 1,i
STWA countC,d
STRO msg,d
DECI letter,d
BR loop
done: STRO msgA,d
LDWA countA,d
DECO countA,d
STRO msgB,d
LDWA countB,d
DECO countB,d
STRO msgC,d
LDWA countC,d
DECO countC,d
STOP
.END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!