I have some OAM code here, and I've looked up all the instructions, what they do how they act, and I've re written it all pseudo, but I'm having a problem locating (so I can count how many) loops are in the program. I feel like it should be staring me in the eyes, and I've done a thousand factorial programs in C/Java etc.. but I can't see it here.
So it takes in user entry if == 0 it breaks to done [brz] if > 0 break to skip [brp] neg used to negate value for abs value
Skip routine does the multiplication and decrememnts, followed by more conditions to see if it needs to be called again or if the program is done.
I need essentially to find the loops in this program. Like I said, it's probably staring me in the face but it's a loosely asked question on the assigner's part..
EDIT to clarify: The program doesn't take the factorial of one number, but rather multplies the factorial of each number entered.
So I could put in 3, -4, 2, 0 and the result will be 288. (3*2*1)(4*3*2*1)(2*1)
EDIT for BRI:
read: noop
lda stdin
brp return
neg
return: bri read