3. Control instructions jsr a Call the subroutine starting at instruction a. ret Return from a subroutine. There are also "compare" and "branch" instructions, which is how you implement for and if statements, but I won't go over them yet. Finally, there are also "directives" which are not really code, but specify that memory must be allocated for variables. For example .globl i Allocate 4 bytes in the globals segment for the variable i. The program counterpoints to where the instruction register must go to load its value. On normal instructions, the pc is incremented by 4 so that the next instruction can be loaded. On control instructions, the pcgets anew value, allowing the machine to call subroutines, perform "if-then" statements, etc.
Page | 26 Here is the list of the opcodes we will be using to construct assembly language programs.