- Immediate
- Direct
- Indirect
- Register
- Register Indirect
- Displacement ( Indexed )
- Stack
1) Immediate Addressing
-> operand merupakan bagian dari instruksi
-> contoh: ADD 5 -> tambah 5 ke dalam isi akumulator
-> no memory reference to fetch data
-> fast
-> limited range
2) Direct Addressing
-> address field contains address of operand
-> EA (effective address) = address field (A)
-> cth: ADD A -> tambah isi dari A dgn akumulator
-> Single memory reference to access data
3) Indirect Addressing
-> address field mengandung alamat dari operand (pointer)
-> EA = (A)
-> contoh: ADD (A) -> lihat isi dari A, mencari alamat isi dari A utk mendapatkan operand
-> may be nested, cascaded, multilevel. cth: EA = (((A)))
Contoh Soal ! !
Tuliskan ADD 400 secara:
- Immediate
- Direct
- Indirect
4) Register Addressing -> paling cepet, krn udh ada di CPU
-> EA = R
5) Register Indirect Addressing
-> EA = (R)
-> operand is in memory cell pointed to by contents of register R
6) Displacement Addressing
-> EA = A + (R)
7) Relative Addressing
-> EA = A + (PC) *PC = Program Counter
-> cth: get operand from A cells from current location pointed to by PC
8) Base-Register Addressing
(gw gagitu ngerti, jd modal copas aja ya)
-> A holds displacement
-> R holds pointer to base address
-> R may be implicit or explicit
-> cth: segment registers in 80x86
9) Indexed addressing
-> A = Base
-> R = displacement
-> EA = A + R
-> Good for accessing arrays
EA = A + R
R++
10) Combinations
-> Postindex
EA = (A) + (R)
-> Preindex
EA = (A + (R))
11) Stack Addressing
-> operand is (implicitly) on top of stack
**Stack pointer: register yang menyimpan alamat paling atas dari stack
^^^keluar di kuis pak Tatang
JAWABAN LATIHAN SOAL
Immediate: A = 400
Direct: A = 420
Indirect: A = 470
0 comments:
Post a Comment