0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)
22 Ansichten1 Seite
This document describes a subprogram and macro that both increment the value in variable #1 by 2 with each execution. The subprogram uses the same #1 as the calling program, resulting in #1 equaling 7 after 3 executions. The macro uses its own #1, independent of the calling program's #1, also resulting in #1 equaling 7 after 3 executions. Both return to the calling program after completing the specified number of repetitions.
This document describes a subprogram and macro that both increment the value in variable #1 by 2 with each execution. The subprogram uses the same #1 as the calling program, resulting in #1 equaling 7 after 3 executions. The macro uses its own #1, independent of the calling program's #1, also resulting in #1 equaling 7 after 3 executions. Both return to the calling program after completing the specified number of repetitions.
This document describes a subprogram and macro that both increment the value in variable #1 by 2 with each execution. The subprogram uses the same #1 as the calling program, resulting in #1 equaling 7 after 3 executions. The macro uses its own #1, independent of the calling program's #1, also resulting in #1 equaling 7 after 3 executions. Both return to the calling program after completing the specified number of repetitions.
#1 = #1 + 2; (Since this program has been called as a subprogram,
#1 used here is the same as #1 of the calling
program 00013. Since every execution of this program adds 2 to the value stored in #1, the final value becomes 7, after three executions) #500 #1; (#500 stores 3 after the first execution, 5 after the second, and 7 after the third and final execution) M99; (Return to the calling program, after all the specified number of repetitions are over. After the return, #1 of the calling program would contain 7, since it is the same as #1 of this subprogram) 00015; (Program number 15) #1 = #1 + 2. (Since this program has been called as a macro, #1 used here is different from #1 of the calling program 00013. The macro call assigns a value of 1 to the macro variable #1, in the beginning of the first call of this program. The repeated calls use the updated values of #1. Since every execution of this program adds 2 to the value stored in #1, the final value becomes 7, after three executions) #501 #1; (#501 stores 3 after the first execution, 5 after the second, and 7 after the third and final execution) M99; (Return to the calling program, after all the specified number of repetitions are over. Since #1 of this program and #1 of the calling program are different