This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: c A.H.Dixon CMPT 150: Week 10 (Mar 10 - 14, 2008) 83 30 PROGRAMMING PROCESSORS While the processor described previously is capable of performing any of the func- tions defined by the ALU and, in particular, the eight functions defined in the previous table, it is capable of performing other functions not defined by the table as well. For example, consider the task of subtracting the values stored in two locations in memory and then saving the result. Suppose that the values to be subtracted are in locations 12 and 13 of memory, and that the result is to be stored in location 14. There is no ALU function to subtract, and clearly the problem descriptions suggests a sequence of tasks: get the values from memory into registers A and B; subtract them; store the result in memory. However, as was described previously, subtraction is possible by performing a sequence of ALU functions: increment A; complement B; add A and B. Definition : A machine language program is a sequence of control input assign- ments to a processor that, when performed in the order given, performs a more complex task. In this case the program needed to address the problem described consists of a sequence of control input assignments that perform the following register transfer statements. Beside each is the appropriate opcode that specifies the needed con- trol input assignments and an address defining a location in memory. Note that each statement corresponds to one assignment of values to the control inputs as determined by the eight rows of the function table given previously: step statement opcode address (ad) 1 A <- M 000 1100 2 B <- M 001 1101 3 A <- A plus 1 110 4 B <- B 101 5 A <- A plus B 100 6 M <- A 010 1110 So if the contents of M = 2 and the contents of M = 3, then by assigning to the input ports opcode and ad of the processor, the values given in the table in the order indicated, the effect would be to perform the steps given, leaving the value -1 in M. The binary sequence defined by the opcode and ad is called a machine language instruction , and the sequence of machine instructions given in the table above is the machine language program. c A.H.Dixon CMPT 150: Week 10 (Mar 10 - 14, 2008) 84 31 STORED PROGRAMS Rather that physically entering each machine language instruction of a program individually in the order needed, they can be stored in a memory because they are binary sequences. The execution of the machine language program then consists of retrieving the instructions, one at a time, from the memory and applying them to the opcode and ad ports as was previously done manually. When a program and the data that it will access are stored in the same memory unit, the processor organization is called a “von Neumann Computer Model”. This model is the one used in over 90% of computers today....
View Full Document
- Spring '08
- Assembly Language, Assembly language program, machine language, Machine code, Language program