Presentation is loading. Please wait.

Presentation is loading. Please wait.

2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.

Similar presentations


Presentation on theme: "2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register."— Presentation transcript:

1 2.3) Example of program execution 1

2 instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register is the same as that in register 0. This part of the operand identifies the register to be compared to register 0. This part of the operand is the address to be placed in the program counter. 2

3 TranslationEncoded instruction Load register 5 with the bit pattern found in the memory cell at address 6C. 156C Load register 6 with the bit pattern found in the memory cell at address 6D 166D Add the content of register 5 and 6 as through they were two’s complement representation and leave the result in register 0. 5056 Store the contents of register 0 in the memory cell at address 6E. 306E Halt (Stop)C000 3 This an example to load two values from memory 6C and 6D in registers 5 & 6. Then add the values from registers 5 & 6 and put the result in register 0. after that store value in register 0 in memory address 6E. Then stop.

4 The program stored in main memory ready for execution 4 CPU Main memory program is stored in main memory beginning at address A0 Registers 0 1 2 3 4 5 6. F ? ? ? A0 156C Program Program counter Instruction register Address Cells A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 15 6C 16 6D 50 56 30 6E C0 00 Bus


Download ppt "2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register."

Similar presentations


Ads by Google