This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
operational_statements [2020/09/21 07:37] adminz [Display] |
operational_statements [2020/11/16 22:03] adminz [Execute] |
||
---|---|---|---|
Line 30: | Line 30: | ||
The ''Execute'' statement allows one program to call another as a //subroutine//. When this happens, the state of Registers ''0'' through ''7'' are saved and later restored when the called program exits. Any changes made to those registers by the called program are lost when the called program returns. Those registers are also set to zero before the called program starts execution. These registers are called **local registers**, because their values are local to the program being executed. | The ''Execute'' statement allows one program to call another as a //subroutine//. When this happens, the state of Registers ''0'' through ''7'' are saved and later restored when the called program exits. Any changes made to those registers by the called program are lost when the called program returns. Those registers are also set to zero before the called program starts execution. These registers are called **local registers**, because their values are local to the program being executed. | ||
- | Registers ''8'' through ''F'' are not saved and restored - they are passed to the called program intact and any changes made to them by the called program remains intact when the called program returns. This allows those registers registers to be used to pass information to and from other called programs. These registers are called **global registers**, because their values are global to all programs being executed. | + | Registers ''8'' through ''F'' are not saved and restored - they are passed to the called program intact and any changes made to them by the called program remains intact when the called program returns. This allows those registers to be used to pass information to and from other called programs. These registers are called **global registers**, because their values are global to all programs being executed. |
The syntax of the ''Execute'' statement is: ''Execute <name>;'' or ''Execute <number>;'' | The syntax of the ''Execute'' statement is: ''Execute <name>;'' or ''Execute <number>;'' |