# Sample Program R: EQU -10 ONE: EQU MM CLEAN: EQU 999 MAIN: PROC # Read F INP 98 # C=(A+B)*10 CLA A ADD B SFT 100 STO K JMP PRINT # Print A,B,C,F # C = A*F CLA C SFT CLEAN # Accumulator has zero STO C # Store 0 in C LOOP: CLA F # Use F as a counter SUB ONE STO F # F = F - 1 TAC DONE # If F = 0 jump to DONE CLA C # else C = C + A ADD A STO C JMP LOOP # Repeat DONE: JMP PRINT # Now IF C < B stop jump to error routine # C = C - B CLA A sub B TAC ERROR # if C-B is negative then error low: STO C JMP PRINT END: ENDP A: CEL +20 B: CEL 1000 C: CEL 30 CEL 40 CEL F: CEL -1000 # Examples of a subroutines using PROC PRINT: PROC OUT A OUT B OUT C OUT F ENDP ENDP ERROR: PROC # On error print C and stop executing OUT C HRS ONE ENDP TEST: PROC CLA A