Arsitektur Komputer Pertemuan – 11 Mode Pengalamatan © 2009 Fakultas Teknologi Informasi Universitas Budi Luhur Jl. Ciledug Raya Petukangan Utara Jakarta Selatan 12260 Website: http://fti.bl.ac.id Email: sekretariat_fti@bl.ac.id Mode Pengalamatan Mode Pengalamatan 1. Immediate 2. Direct 3. Indirect 4. Register 5. Register Indirect 6. Displacement (Indexed) 7. Stack Pengalamatan: Immediate 1. Operand adalah bagian dari instruksi 2. Operand = address field e.g. ADD 5 3. Tambah 5 ke Isi Akumulator 4. 5 adalah operand 5. Tdk ada referensi memori utk fetch data 6. Cepat 7. Range Terbatas Mode Pengalamatan Format Instruksi : Immediate Instruction Opcode Operand Pengalamatan: Direct Addressing 1. Address field mengandung alamat o operand 2. Effective address (EA) = address field (A) e.g. ADD A 3. Tambahkan isi A ke accumulator 4. Lihat address A sebagai operand 5. Single memory reference untuk akses data 6. Tak ada kalkulasi tambahan untuk effective address 7. Jangkauan Alamat terbatas Mode Pengalamatan Format Instruksi : Direct Mode Pengalamatan Pengalamatan: Indirect 1. Sel Memori ditunjuk oleh field alamat yang mengandung alamat operand 2. EA = (A) Look in A, temukan alamat (A) dan cari operand e.g. ADD (A) Tambahkan isi dari sel yang ditunjuk dengan isi dai akumulator A Format Instruksi: Indirect Mode Pengalamatan Pengalamatan: Register 1. Operand is held in register named in address filed 2. EA = R 3. Limited number of registers 4. Very small address field needed 5. Shorter instructions 6. Faster instruction fetch Format Instruksi: Indirect Mode Pengalamatan Pengalamatan: Register Indirect 1. C.f. indirect addressing 2. EA = (R) 3. Operand is in memory cell pointed to by contents of register R 4. Large address space (2n) 5. One fewer memory access than indirect addressing Format Instruksi: Reg. Indirect Mode Pengalamatan Pengalamatan: Displacement 1. EA = A + (R) 2. Address field hold two values 3. A = base value 4. R = register that holds displacement 5. or vice versa Format Instruksi: Reg. Indirect Mode Pengalamatan Pengalamatan: Relative 1. A version of displacement addressing 2. R = Program counter, PC 3. EA = A + (PC) i.e. get operand from A cells from current location pointed to by PC 4. c.f locality of reference & cache usage Pengalamatan: Base Register 1. A holds displacement 2. R holds pointer to base address 3. R may be explicit or implicit 4. e.g. segment registers in 80x86 Mode Pengalamatan Pengalamatan: Indexed 1. A = base 2. R = displacement 3. EA = A + R 4. Good for accessing arrays 5. EA = A + R 6. R++ Pengalamatan: STACK Operand is (implicitly) on top of stack e.g. ADD Pop top two items from stack and add Mode Pengalamatan Pentium Addressing Mode Virtual or effective address is offset into segment Starting address plus offset gives linear address This goes through page translation if paging enabled addressing modes 1. Immediate 2. Register operand 3. Displacement 4. Base 5. Base with displacement 6. Scaled index with displacement 7. Base with index and displacement 8. Base scaled index with displacement 9. Relative Mode Pengalamatan PowerPC Addressing Mode 1. Load/store architecture 2. Indirect Instruction includes 16 bit displacement to be added to base register (may be GP register) Can replace base register content with new address 3. Indirect indexed Instruction references base register and index register (both may be GP) EA is sum of contents 4. Branch address 5. Absolute 6. Relative 7. Indirect 8. Arithmetic Operands in registers or part of instruction Floating point is register only Mode Pengalamatan PowerPC Memory Operand Addressing Modes Mode Pengalamatan Instruction Format PowerPC Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than one instruction format in an instruction set Instruction Length PowerPC Affected by and affects: Memory size Memory organization Bus structure CPU complexity CPU speed Trade off between powerful instruction repertoire and saving space Mode Pengalamatan Alokasi Bit PowerPC Number of addressing modes Number of operands Register versus memory Number of register sets Address range Address granularity Mode Pengalamatan Format Instruksi :PDP-8 Mode Pengalamatan Format Instruksi : Pentium