MGMT 1030 Lecture Notes - Lecture 6: Opcode
![](https://new-preview-html.oneclass.com/L7W93pro8dXxmologMZ8j1VKzkbBJv2e/bg1.png)
MGMT 1030 Tutorial 6 Notes – Mailbox Address
Introduction
• We would like the Little Man to do some useful work.
• For this purpose we have invented a small group of instructions that he can perform.
• Each instruction will consist of a single digit.
• We will use the first digit of a three-digit number to tell the Little Man which operation
to perform.
• In some cases, the operation will require the Little Man to use a particular mailbox to
store or retrieve data (in the form of three-digit numbers, of course!).
• Since the instruction only requires one digit, we can use the other two digits in a three-
digit number to indicate the appropriate mailbox address to be used as a part of the
instruction.
• Thus, using the three digits on a slip of paper we can describe an instruction to the Little
Man according to the diagram: 3 | 25 instructions | mailbox address
• The instruction part of the three-digit code is also kow as a operatio code.
• Op code for short.
• The op code number assigned to a particular instruction is arbitrary, selected by the
computer designer based on various architectural and implementation factors.
• The op codes used by the author conform to the 1979 version of the Little Man
Computer model.
• Now lets defie soe istructios for the Little Man to perform
• LOAD instruction—op code 5
• The Little Man walks over to the mailbox address specified in the instruction.
• He reads the three-digit number located in that mailbox
• Then walks over to the calculator and punches that number into the calculator.
• The three-digit number in the mailbox is left unchanged, but of course the original
number in the calculator is replaced by the new number.
• STORE instruction—op code 3
find more resources at oneclass.com
find more resources at oneclass.com