Presentation is loading. Please wait.

Presentation is loading. Please wait.

Part of the Assembler Language Programmers Toolbox

Similar presentations


Presentation on theme: "Part of the Assembler Language Programmers Toolbox"— Presentation transcript:

1 Part of the Assembler Language Programmers Toolbox
Register types Part of the Assembler Language Programmers Toolbox Copyright © Curt Hill

2 Copyright © 2005- 2007 - Curt Hill
Registers Definition: A group of bits of storage in the CPU Two kinds Special purpose General purpose The special purpose are fading in popularity as the hardware designers get more sophisticated What is actually happening is that a general purpose register is a front for several special purpose registers Copyright © Curt Hill

3 Copyright © 2005- 2007 - Curt Hill
The location Somewhat insignificant They may be logically in CU or ALU Often accessible by both Sometimes a communication mechanism between the two Copyright © Curt Hill

4 Copyright © 2005- 2007 - Curt Hill
Instruction register A location where the instruction is stored for decoding The results determine the rest of the execution of the instruction This one we can usually disregard at this level because it is not programmer accessible on any machine that I am aware of Copyright © Curt Hill

5 Copyright © 2005- 2007 - Curt Hill
Program counter Address of the next instruction A branch is essentially a load of the the program counter The value in the PC is incremented by the size of the instruction (which may be variable) AKA instruction pointer Copyright © Curt Hill

6 Copyright © 2005- 2007 - Curt Hill
Status register Has bits that indicate the operation of the program One or two bits indicate the result of a comparison or arithmetic: Greater or positive Zero or equal Less or negative Overflow Carry out Parity Whether the CPU is in supervisor mode or not Protection key of memory Copyright © Curt Hill

7 Copyright © 2005- 2007 - Curt Hill
Example PSW of IBM 370 This combined the PC and Status flags Two full words 64 bits Channel mask 0-6 External mask 7 Masks 12-15 14 wait 13 machine check 12 Basic control (360 mode) Interruptions code 16-31 Instruct Length Code 32-33 Condition code (34-35) Program mask (36-39) Instruction address (40-63) It had a different interpretation in Extended Control Mode than Basic Copyright © Curt Hill

8 Copyright © 2005- 2007 - Curt Hill
Accumulator The site of arithmetic and logical instructions AKA a DATA register Usually a relatively primitive register in less developed CPUs Copyright © Curt Hill

9 Copyright © 2005- 2007 - Curt Hill
Address register Used to access data or instructions in the program Some examples: Base registers Segment registers Index registers The full discussion of address registers will have to wait for our discussion of addressing modes Copyright © Curt Hill

10 Copyright © 2005- 2007 - Curt Hill
Base register A register specified in an instruction Generally added to an offset that is also in the instruction The contents of the register and offset are summed to provide an effective address The number of bits of offset determine the block addressed by the register System 360 had 12 bits Each block was 4K Copyright © Curt Hill

11 Copyright © 2005- 2007 - Curt Hill
Segment register Used when memory is physically or logically divided into segments Each segment is usually a power of two long The 86 code register addressed 64K A real address then becomes the contents of the register plus some offset built into the instruction This may also include a base or index register Copyright © Curt Hill

12 Copyright © 2005- 2007 - Curt Hill
Index register Usually a base register addresses a block of variables An index register usually hold a pre-multiplied array subscript It is usually used in addition to an offset and base or segment register Thus a memory reference may include the sum of three registers and an offset Copyright © Curt Hill

13 Copyright © 2005- 2007 - Curt Hill
Stack pointer Special type that allows pushes and pops without much regard to length Often allows a displacement to be added for indirection Copyright © Curt Hill

14 General Purpose Registers
General registers are able to do multiple things Accumulator or Data Base or index Copyright © Curt Hill

15 Copyright © 2005- 2007 - Curt Hill
Floating point Floating point registers are usually separate from the integer portions The integer registers are used for almost every instruction By comparison floating point is much less frequently used Many computers had no floating point at all or it was optional Copyright © Curt Hill

16 Copyright © 2005- 2007 - Curt Hill
IBM 360 – Model 30 and above 16 general purpose registers Each is 32 bits All are general purpose with a few exceptions: R0 always supplies a zero when used as an index register Some instructions like the Multiply require a even odd pair of registers There is also the before mentioned PSW, which is not really user accessible Copyright © Curt Hill

17 Copyright © 2005- 2007 - Curt Hill
Intel 8086 General registers: AX BX CX DX Pointer and index Stack SP Base BP Source Index SI Destination DI Segment Code Data Stack Extra Copyright © Curt Hill

18 Copyright © 2005- 2007 - Curt Hill
Intel 80386 When they went 32 bit they had to double the register size Therefore they have EAX which is the entire 32 and AX which is the lower 16 for compatibility with old 86 Copyright © Curt Hill

19 Copyright © 2005- 2007 - Curt Hill
Motorola 68000 8 data registers 8 address registers The last of which is stack pointer Two versions of this: one for system and one for user Status register Status and program counter Copyright © Curt Hill


Download ppt "Part of the Assembler Language Programmers Toolbox"

Similar presentations


Ads by Google