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 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
countB: WORD
countC: WORD
letter: WORD
msg: ASCII "Enter a letter A B C or X to quit: x
msgA: ASCII "Number of As: x
msgB: ASCII "Number of Bs: x
msgC: ASCII "Number of Cs: x
main: STRO msgd
DECI letter,d
loop: LDWA letter,d
CPWA Xi
BREQ done
CPWA Ai
BREQ NOA
CPWA Bi
BREQ NOB
CPWA Ci
BREQ NOC
STRO msgd
DECI letter,d
BR loop
NOA: LDWA countA,d
ADDA i
STWA countA,d
STRO msgd
DECI letter,d
BR loop
NOB: LDWA countB,d
ADDA i
STWA countB,d
STRO msgd
DECI letter,d
BR loop
NOC: LDWA countC,d
ADDA i
STWA countC,d
STRO msgd
DECI letter,d
BR loop
done: STRO msgA,d
LDWA countA,d
DECO countA,d
STRO msgBd
LDWA countB,d
DECO countB,d
STRO msgCd
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
