Professional Documents
Culture Documents
Bentuk umum:
Upcode Opd1
0110 Acc<- B
Load B
0111 Acc<- Acc + C
Add C
0112 Sub D Acc<- Acc - D
store A
0113 A<-Acc
A:= B+C-D
Untuk menyimpan hasil maka harus ditentukan operan keduanya diletakkan dimana,
misalkan pada alamat R0 . Sebagai contoh:
Add a berarti R0 = a + R0
Instruksi mesin
2. Jelaskan dan berikan contoh set instruksi untuk prosessor yang memiliki 0-alamat
Jawab :
Bentuk umum:
Upcode Opd1
Ekspresi arithmatika yang akan dijalankan di mesin sudah harus dalam bentuk notasi
polish.
Contoh:
- mis. Operasi A=B + C
PUSH B
PUSH C
ADD
POP A
Catatan: semua operand implisitmenggunakanmemoritumpukan(stack)
- Operasi-c + ba
PUSH a
PUSH b
ADD (pop a dan b dari stack danditambahkan, c := a + b)
PUSH C
SUB
*Ket: PUSH : Memindahkan word dari sumber kebagian paling atas stack.
3. Tuliskan jenis-jenis dan perbedaan instruksi microprosessor 80x86 dengan MIPS serta
bandingkan keduanya.
Jawab:
Jenis – jenis instruksi microprosessor 8086
Petunjuk dalam 8086, dapat diklasifikasikan ke dalam 13 kelompok berdasarkan
fungsinya:
1. Instruksi Transfer Data
2. Instruksi Aritmatika
- Addition Instructions - ADD, ADC, INC, AAA, DAA
3. Instruksi Logika
4. Compare Instruction
Instruction to compare two 8 bit or 16 bit numbers
- CMP
5. Jump Instructions
Unconditional
- JMP
Conditional
- Jcc
6. Loop Instruksi
Three instructions specifically designed for implementing loops.
- LOOP
- LOOPE/LOOPZ
- LOOPNE/LOOPNZ
7. Shift Instruksi
- Logical shift
SHL, SHR
- Arithmetic shift
SAL, SAR
8. Rotate Instructions
- ROL, ROR, RCL, RCR
CALL and RET instructions
PUSH and POP instructions
9. Bendera Kontrol Instruksi
10. String Instruksi
11. Input / Output Instruksi
- IN
- OUT
12. Instruksi Interrupt
Number of instructions for processing interrupts
- CLI
- STI
- INT n
- IRET
- INTO
- HLT
- WAIT
13. Subrutin dan instruksi penanganan subrutin.
Jenis-jenis instruksi MIPS
Instruksipada MIPS dibagidalamtigabentuk format yakni:
- R format terdiridaritiga register dan function field
- I format terdiriatasdua register dan 16 bit long immediate value
- J format terdiriatasenam bit opcode yang diikutioleh 26 bits immediate value
Jenis-jenisinstruksi
Add – penambahan
Addi – Add immediate
ADDIU -- Add immediate unsigned
ADDU -- Add unsigned
AND -- Bitwise and
ANDI -- Bitwise and immediate
BEQ -- Branch on equal
BGEZ -- Branch on greater than or equal to zero
BGEZAL -- Branch on greater than or equal to zero and link
BGTZ -- Branch on greater than zero
BLEZ -- Branch on less than or equal to zero
BLTZ -- Branch on less than zero
BLTZA -- Branch on less than zero and link
BNE -- Branch on not equal
DIV -- Divide
DIVU -- Divide unsigned
J -- Jump
JAL -- Jump and link
JR -- Jump register
LB -- Load byte
LUI -- Load upper immediate
LW -- Load word
MFHI -- Move from HI
MFLO -- Move from LO
MULT -- Multiply
MULTU -- Multiply unsigned
NOOP -- no operation
OR -- Bitwise or
ORI -- Bitwise or immediate
SB -- Store byte
SLL -- Shift left logical
SLLV -- Shift left logical variable
SLT -- Set on less than (signed)
SLTI -- Set on less than immediate (signed)
SLTIU S l h i di i d --Set on less than immediate unsigned
SLTU -- Set on less than unsigned
SRA -- Shift right arithmetic
SRL -- Shift right logical
SRLV -- Shift right logical variable
SUB – Subtract
SUBU -- Subtract unsigned
SW -- Store word
SYSCALL -- System call
XOR -- Bitwise exclusive or
XORI -- Bitwise exclusive or immediate
Perbedaan MIPS dan microprosessor 8086