Course MATH 0017 Slide 1 Operand access modes

  • Slides: 7
Download presentation
Course MATH 0017 Slide 1 Operand access modes (a) Recalling the 68000 addition operation,

Course MATH 0017 Slide 1 Operand access modes (a) Recalling the 68000 addition operation, the control word was: 1101 ADD 101 001 D 5 Add 16 -bit word to data register 111000 16 -bit operand address follows The heavily boxed part represents a mode field that allows us to change the way an operand is accessed. In this case, it is by giving the 16 -bit address of the operand. Copyright © Dr N M Brooke

Course MATH 0017 Slide 1 Operand access modes (b) If we had set this

Course MATH 0017 Slide 1 Operand access modes (b) If we had set this field of the instruction control word as follows: then the 16 -bit extension word that followed would have been treated not as the address of the operand, but as the value of the operand. So, if the extension word contained 1202 (hex. ) as before, we would add the value 1202 (hex. ) to data register 5. Clearly there are potentially many different ways of using the bits of this field and this is important in determining the power of a computer’s instructions. Copyright © Dr N M Brooke

Course MATH 0017 Slide 1 Operand access modes (c) General structure of instructions We

Course MATH 0017 Slide 1 Operand access modes (c) General structure of instructions We can summarise what we have discovered by observing that even the simplest, one-address, instruction in general has not just two, but three parts: • Operation specification; • Operand specification; and • Mode specification (to determine how the operand is interpreted) Copyright © Dr N M Brooke

Course MATH 0017 Slide 1 Operand access modes (d) Further examples of different modes

Course MATH 0017 Slide 1 Operand access modes (d) Further examples of different modes of operand access • Indirection: the operand is a location of store or a register which contains not data, but the another address (where the true operand will be found); • Indexing, or address modification: the operand is added to the contents of a special register (the index register) and the sum is the address in store of the operand itself. These methods are powerful because, by changing the register or store contents, we can change the effect of the instructions. Copyright © Dr N M Brooke

Course MATH 0017 Slide 1 Operand access modes (e) Indirection: A final 68000 architecture

Course MATH 0017 Slide 1 Operand access modes (e) Indirection: A final 68000 architecture example (a) As well as eight data registers, the CPU of this series of machines has eight address registers (only the accessible registers are shown here): Copyright © Dr N M Brooke

Course MATH 0017 Slide 1 Operand access modes (f) Indirection (b) Returning again to

Course MATH 0017 Slide 1 Operand access modes (f) Indirection (b) Returning again to the control word of the addition operation on the 68000 machines, we can set the mode field as shown here Now the mode indicates that the address of the operand is to be found in the address register 3 (the second group of three bits in the mode field is used to specify a particular register). This instruction has no extension word. Copyright © Dr N M Brooke

Course MATH 0017 Slide 1 Operand address modes (g) Indirection (c) Thus, let us

Course MATH 0017 Slide 1 Operand address modes (g) Indirection (c) Thus, let us suppose that the address register 3 contains and the bytes at locations 1234 and 1235 (hex. ) of the store unit contain 0111 1010 1111 0011 Then the add operation with this operand will add 7 AF 3 (hex. ) to the existing contents of the data register 5. By changing the address in address register 3, we can change the effect of the operation. Copyright © Dr N M Brooke