Addressing Modes Charles Abzug, Ph.D. Department of Computer Science James Madison University Harrisonburg, VA 22807 Voice Phone: 540-568-8746, E-mail: CharlesAbzug@ACM.org Home Page: http://www.cs.jmu.edu/users/abzugcx © 2002 Charles Abzug
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)
Figure 8.54 from Maxfield & Brown
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 %10110101 #(Add [to Accumulator] with Carry) BLDSP $4317 #(“Big” Load Stack Pointer)
Figure 8.55 from Maxfield & Brown
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 %10110101 #(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
Figure 8.58 from Maxfield & Brown
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]]
Figure 8.63 from Maxfield & Brown
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]
Figure 8.65 from Maxfield & Brown
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]]
Figure 8.68 from Maxfield & Brown
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]
Figure 8.69 from Maxfield & Brown
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.
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
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 %10110101 #(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
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]
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.
END