Presentation is loading. Please wait.

Presentation is loading. Please wait.

Addressing Modes Charles Abzug, Ph.D. Department of Computer Science

Similar presentations


Presentation on theme: "Addressing Modes Charles Abzug, Ph.D. Department of Computer Science"— Presentation transcript:

1 Addressing Modes Charles Abzug, Ph.D. Department of Computer Science
James Madison University Harrisonburg, VA 22807 Voice Phone: , Home Page: © 2002 Charles Abzug

2 Addressing Modes in the Beboputer
Implied: The location(s) acted upon are implied by the instruction mnemonic (the name of the instruction), and therefore are not separately specified. EXAMPLES: INCA #(Increment Accumulator) DECX #(Decrement Index Register) PUSHSR #(Push Status Register) CLRIM #(Clear Interrupt Mask)

3 Figure 8.54 from Maxfield & Brown

4 Addressing Modes in the Beboputer (continued)
Implied: The location(s) acted upon are implied by the instruction mnemonic (the name of the instruction), and therefore are not separately specified. EXAMPLES: INCA #(Increment Accumulator) DECX #(Decrement Index Register) PUSHSR #(Push Status Register) CLRIM #(Clear Interrupt Mask) Immediate: The value of the operand is specified in the body of the program immediately following the instruction opcode. EXAMPLES: LDA $F3 #(Load Accumulator) ADDC % #(Add [to Accumulator] with Carry) BLDSP $4317 #(“Big” Load Stack Pointer)

5 Figure 8.55 from Maxfield & Brown

6 Addressing Modes in the Beboputer (continued)
Implied: The location(s) acted upon are implied by the instruction mnemonic (the name of the instruction), and therefore are not separately specified. EXAMPLES: INCA #(Increment Accumulator) DECX #(Decrement Index Register) PUSHSR #(Push Status Register) CLRIM #(Clear Interrupt Mask) Immediate: The value of the operand is specified in the body of the program immediately following the instruction opcode. EXAMPLES: LDA $F3 #(Load Accumulator) ADDC % #(Add [to Accumulator] with Carry) BLDSP $4317 #(“Big” Load Stack Pointer) Absolute: Instead of the value of the operand, the ADDRESS of the operand follows immediately after the instruction opcode. EXAMPLES: LDA [DATA] #(Load Accumulator) LDA [$4317] #(Load Accumulator

7 Figure 8.58 from Maxfield & Brown

8 Addressing Modes in the Beboputer (continued)
Indirect: The address of the address of the operand follows immediately after the instruction opcode. EXAMPLES: LDA [[DATA]] LDA [[$4317]]

9 Figure 8.63 from Maxfield & Brown

10 Addressing Modes in the Beboputer (continued)
Indirect: The address of the address of the operand follows immediately after the instruction opcode. EXAMPLES: LDA [[DATA]] LDA [[$4317]] Indexed: The value of the Index Register is added to the base address which follows immediately after the instruction opcode. Useful for accessing elements of an array. EXAMPLES: LDA [DATA,X] LDA [$4317,X]

11 Figure 8.65 from Maxfield & Brown

12 Addressing Modes in the Beboputer (continued)
Indirect: The address of the address of the operand follows immediately after the instruction opcode. EXAMPLES: LDA [[DATA]] LDA [[$4317]] Indexed: The value of the Index Register is added to the base address which follows immediately after the instruction opcode. Useful for accessing elements of an array. EXAMPLES: LDA [DATA,X] LDA [$4317,X] Pre-Indexed Indirect: The address of the address of the operand is modified by adding the value of the Index Register. EXAMPLES: LDA [[DATA,X]] LDA [[$4317,X]]

13 Figure 8.68 from Maxfield & Brown

14 Addressing Modes in the Beboputer (continued)
Indirect: The address of the address of the operand follows immediately after the instruction opcode. EXAMPLES: LDA [[DATA]] LDA [[$4317]] Indexed: The value of the Index Register is added to the base address which follows immediately after the instruction opcode. Useful for accessing elements of an array. EXAMPLES: LDA [DATA,X] LDA [$4317,X] Pre-Indexed Indirect: The address of the address of the operand is modified by adding the value of the Index Register. EXAMPLES: LDA [[DATA,X]] LDA [[$4317,X]] Indirect Post-Indexed: The value of the Index Register is not added until the second stage of address resolution. EXAMPLES: LDA [[DATA],X] LDA [[$4317],X]

15 Figure 8.69 from Maxfield & Brown

16 Addressing Modes (continued)
ADDITIONAL ADDRESSING MODES COMMONLY USED in digital computers, although not in the Beboputer: Pre-Indexed Indirect AutoINcrement: Value stored in Index Register is automatically incremented each time the instruction is executed. Pre-Indexed Indirect AutoDEcrement: Value stored in Index Register is automatically decremented each time the instruction is executed. Indirect Post-Indexed AutoINcrement: Value stored in Index Register is automatically incremented each time the instruction is executed. Indirect Post-Indexed AutoDEcrement: Value stored in Index Register is automatically decremented each time the instruction is executed.

17 Op Codes and Addressing Modes
Mnemonic Implied Immediate Absolute Indexed Indirect Pre-Indexed Post-Indexed LDA $90 $91 $92 $93 $94 $95 STA $99 $9A $9B $9C $9D JMP $C1 $C2 $C3 $C4 $C5 JSR $C9 $CA $CB $CC $CD

18 Summary of Beboputer Addressing Modes
Implied: The location(s) acted upon are implied by the instruction mnemonic (the name of the instruction), and therefore are not separately specified. EXAMPLES: INCA #(Increment Accumulator) DECX #(Decrement Index Register) PUSHSR #(Push Status Register) CLRIM #(Clear Interrupt Mask) Immediate: The value of the operand is specified in the body of the program immediately following the instruction opcode. EXAMPLES: LDA $F3 #(Load Accumulator) ADDC % #(Add [to Accumulator] with Carry) BLDSP $4317 #(“Big” Load Stack Pointer) Absolute: Instead of the value of the operand, the ADDRESS of the operand follows immediately after the instruction opcode. EXAMPLES: LDA [DATA] #(Load Accumulator) LDA [$4317] #(Load Accumulator

19 Summary of Beboputer Addressing Modes (continued)
Indirect: The address of the address of the operand follows immediately after the instruction opcode. EXAMPLES: LDA [[DATA]] LDA [[$4317]] Indexed: The value of the Index Register is added to the base address which follows immediately after the instruction opcode. Useful for accessing elements of an array. EXAMPLES: LDA [DATA,X] LDA [$4317,X] Pre-Indexed Indirect: The address of the address of the operand is modified by adding the value of the Index Register. EXAMPLES: LDA [[DATA,X]] LDA [[$4317,X]] Indirect Post-Indexed: The value of the Index Register is not added until the second stage of address resolution. EXAMPLES: LDA [[DATA],X] LDA [[$4317],X]

20 Summary of Addressing Modes (continued)
ADDITIONAL ADDRESSING MODES COMMONLY USED, but not in Beboputer Pre-Indexed Indirect AutoINcrement: Value stored in Index Register is automatically incremented each time the instruction is executed. Pre-Indexed Indirect AutoDEcrement: Value stored in Index Register is automatically decremented each time the instruction is executed. Indirect Post-Indexed AutoINcrement: Value stored in Index Register is automatically incremented each time the instruction is executed. Indirect Post-Indexed AutoDEcrement: Value stored in Index Register is automatically decremented each time the instruction is executed.

21 END


Download ppt "Addressing Modes Charles Abzug, Ph.D. Department of Computer Science"

Similar presentations


Ads by Google