Dale - Computer Science Illuminated 219

Dale - Computer Science Illuminated 219 - 32,767 to +32,767...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
192 Chapter 7 Low-Level Programming Languages Figure 7.2 The Pep/7 instruction format Instruction specifier Operand specifier (a) The parts of an instruction (b) The instruction specifier part of an instruction Addressing-mode specifier Register specifier ( R ) Operation code themselves are not stored in memory, but that they name the individual bytes of memory. We refer to any particular byte in memory by its address. Before we go on, let’s review some aspects of binary and hexadecimal numbers. The largest decimal value that can be represented in a byte is 255. This occurs when all of the bits are 1’s: 11111111 in binary is FF in hexadecimal and 255 in decimal. The largest decimal value that can be represented in a word (16 bits) is 65,535. This occurs when all 16 bits are 1’s: 1111111111111111 in binary is FFFF in hexadecimal and 65,535 in decimal. If we represent both positive and negative numbers, we lose a bit in the magnitude (because one is used for the sign), so we can represent values ranging from ± 7FFF to +7FFF in hexadecimal, which is from
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 32,767 to +32,767 in decimal. This information is important when working with the Pep/7 machine. The number of bits we have available determines the size of the numbers we can work with. Instruction Format We have talked about instructions going into the instruction register, being decoded, and being executed. Now we are ready to look at a set (or subset) of concrete instructions that a computer can execute. But first, we need to examine the format of an instruction in Pep/7. Figure 7.2 shows the format for an instruction in Pep/7. There are two parts to an instruction: the 8-bit instruction specifier and (optionally) the 16-bit operand specifier . The instruction specifier (the first byte of the instruction) indicates what operation is to be carried out, such as Add a number to a value already stored in a register, and how to interpret just where the operand is. The operand specifier (the second and third bytes of...
View Full Document

Ask a homework question - tutors are online