Com 212 intro to system programming book Theory



Download 0.65 Mb.
View original pdf
Page20/72
Date13.05.2021
Size0.65 Mb.
#56617
1   ...   16   17   18   19   20   21   22   23   ...   72
com-212-introduction-to-system-programming-theory
9833 SS1 FISHERY LESSON NOTE
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 pc gets 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.

Download 0.65 Mb.

Share with your friends:
1   ...   16   17   18   19   20   21   22   23   ...   72




The database is protected by copyright ©ininet.org 2024
send message

    Main page