Difference between revisions of "CSC103: DT's Notes 1"
Line 1,270: | Line 1,270: | ||
! Explanations | ! Explanations | ||
|- | |- | ||
− | | | + | |style="width: 25%; background-color: white;"| |
@0 | @0 | ||
| | | | ||
Line 1,294: | Line 1,294: | ||
HLT | HLT | ||
| | | | ||
− | Halt! All programs must end. This is the instruction that makes a program end. When this instruction is executed, the simulator stops. Real processors will continue working, however. In real computers, when a program stops the Operating Systems resumes. | + | <br /> |
+ | Halt! All programs must end. This is the instruction that makes a program end. When this instruction is executed, the simulator stops. Real processors will continue working, however. In real computers, when a program stops the Operating Systems resumes.<br /> | ||
+ | | ||
|- | |- | ||
| | | | ||
| | ||
| | | | ||
− | Blank line. A blank line in an assembly language program doesn't do anything. It is there just to create a division between two logically different section. Here we are separating the code (the instructions between LOD 10 and HLT) from the data (the three variables that follow). | + | <br /> |
+ | Blank line. A blank line in an assembly language program doesn't do anything. It is there just to create a division between two logically different section. Here we are separating the code (the instructions between LOD 10 and HLT) from the data (the three variables that follow).<br /> | ||
+ | | ||
|- | |- | ||
| | | | ||
Line 1,309: | Line 1,313: | ||
3 | 3 | ||
| | | | ||
+ | <br /> | ||
The number 3 should be stored at 10. This is our first variable. The translator accepts instructions or numbers. It doesn't matter. We could have entered our whole program as a series of numbers, if we knew ahead of time the code representing LOD, | The number 3 should be stored at 10. This is our first variable. The translator accepts instructions or numbers. It doesn't matter. We could have entered our whole program as a series of numbers, if we knew ahead of time the code representing LOD, | ||
− | ADD, STO and HLT. But it's much easier to use these ''mnemonics'' for the code. For the data, however, they are always numbers. So we simply enter their value. | + | ADD, STO and HLT. But it's much easier to use these ''mnemonics'' for the code. For the data, however, they are always numbers. So we simply enter their value. <br /> |
+ | <br /> | ||
|- | |- | ||
| | | | ||
Line 1,326: | Line 1,332: | ||
|} | |} | ||
− | + | <center>[[Image:CSC103FirstAssemblyProgSimul1.jpg|400px]]</center> | |
+ | <center>[[Image:CSC103FirstAssemblyProgSimul2.jpg|400px]]</center> | ||
+ | <center>[[Image:CSC103FirstAssemblyProgSimul3.jpg|400px]]</center> | ||
+ | <center>[[Image:CSC103FirstAssemblyProgSimul4.jpg|400px]]</center> | ||
+ | <center>[[Image:CSC103FirstAssemblyProgSimul5.jpg|400px]]</center> | ||
Revision as of 19:58, 28 September 2013
--© D. Thiebaut 08:10, 30 January 2012 (EST)