Skip to content

Set Instruksi MCS-51

June 26, 2008

Operasi
Aritmatika

Mnemonic

Deskripsi

Ukuran

Cycle

ADD A,Rn

Menambahkan register ke accumulator (ACC)

1

1

ADD A,direct

Menambahkan direct byte to ACC

2

1

ADD A,@Ri

Menambahkan indirect RAM ke ACC

1

1

ADD A,#data

Menamabhkan data ke ACC

2

1

ADDC A,Rn

Menambahkan register ke ACC dengan carry

1

1

ADDC A,direct

Menanbahkan direct byte ke ACC dengan carry

2

1

ADDC A,@Ri

Menambahkan indirect RAM ke ACC dengan carry

1

1

ADDC A,#data

Menambahkan data ke ACC dengan carry

2

1

SUBB A,Rn

Subtract register from ACC with borrow

1

1

SUBB A,direct

Subtract direct byte from ACC with borrow

2

1

SUBB A,@Ri

Subtract indirect RAM from ACC with borrow

1

1

SUBB A,#data

Subtract immediate data from ACC with borrow

2

1

INC A

Increment ACC

1

1

INC Rn

Increment register

1

1

INC direct

Increment direct byte

2

1

INC @Ri

Increment indirect RAM

1

1

INC DPTR

Increment data pointer

1

2

DEC A

Decrement ACC

1

1

DEC Rn

Decrement register

1

1

DEC direct

Decrement direct byte

2

1

DEC @Ri

Decrement indirect RAM

1

1

MUL AB

Mengalikan A dan B

1

4

Hasil: A<- low byte ; B-> high byte

DIV AB

Membagi A dengan B

1

4

Hasil: A<-Seluruh bagian ; B<- remainder

DA A

Mengubah ACC menjadi decimal

1

1

Operasi Logika

Mnemonic

Deskripsi

Ukuran

Cycle

ANL A,Rn

AND register to ACC

1

1

ANL A,direct

AND direct byte to ACC

2

1

ANL A,@Ri

AND indirect RAM to ACC

1

1

ANL A,#data

AND immediate data to ACC

2

1

ANL direct,#data

AND immediate data to direct byte

3

2

ORL A,Rn

OR register to ACC

1

1

ORL A,direct

OR direct byte to ACC

2

1

ORL A,@Ri

OR indirect RAM to ACC

1

1

ORL A,#data

OR immediate data to ACC

2

1

ORL direct,A

OR ACC to direct byte

2

1

ORL direct,#data

OR immediate data to direct byte

3

2

XRL A,Rn

Exclusive OR register to ACC

1

1

XRL A,direct

Exclusive OR direct byte to ACC

2

1

XRL A,@Ri

Exclusive OR indirect RAM to ACC

1

1

XRL A,#data

Exclusive OR immediate data to ACC

2

1

XRL direct,A

Exclusive OR ACC to direct byte

2

1

XRL direct,#data

XOR immediate data to direct byte

3

2

CLR A

Clear ACC (set all bits to zero)

1

1

CPL A

Compliment ACC

1

1

RL A

Rotate ACC left

1

1

RLC A

Rotate ACC left through carry

1

1

RR A

Rotate ACC right

1

1

RRC A

Rotate ACC right through carry

1

1

SWAP A

Swap nibbles within ACC

1

1

Transfer Data

Mnemonic

Description

Size

Cycle

MOV A,Rn

Memindahkan register ke ACC

1

1

MOV A,direct

Memindahkan direct byte ke ACC

2

1

MOV A,@Ri

Memindahkan indirect RAM ke ACC

1

1

MOV A,#data

Memindahkan data ke ACC

2

1

MOV Rn,A

Memindahkan ACC ke register

1

1

MOV Rn,direct

Memindahkan direct byte ke register

2

2

MOV Rn,#data

Memindahkan data ke register

2

1

MOV direct,A

Memindahkan ACC ke direct byte

2

1

MOV direct,Rn

Memindahkan register ke direct byte

2

2

MOV direct,direct

Memindahkan direct byte ke direct byte

3

2

MOV direct,@Ri

Memindahkan indirect RAM ke direct byte

2

2

MOV direct,#data

Memindahkan data ke direct byte

3

2

MOV @Ri,A

Memindahkan ACC ke indirect RAM

1

1

MOV @Ri,direct

Memindahkan direct byte ke indirect RAM

2

2

MOV @Ri,#data

Memindahkan data ke indirect RAM

2

1

MOV DPTR,#data16

Memindahkan 16bit data ke data pointer register

3

2

MOVC A,@A+DPTR

Memindahkan code byte relative ke DPTR to ACC
(16bit address)

1

2

MOVC A,@A+PC

Memindahkan code byte relative ke PC to ACC
(16bit address)

1

2

MOVX A,@Ri

Memindahkan external RAM ke ACC (8bit address)

1

2

MOVX A,@DPTR

Memindahkan external RAM ke ACC (16bit address)

1

2

MOVX @Ri,A

Memindahkan ACC ke external RAM (8bit address)

1

2

MOVX @DPTR,A

Memindahkan ACC ke external RAM (16bit address)

1

2

PUSH direct

Memasukkan direct byte ke dalam stack

2

2

POP direct

Mengambil direct byte dari stack

2

2

XCH A,Rn

Exchange register with ACC

1

1

XCH A,direct

Exchange direct byte with ACC

2

1

XCH A,@Ri

Exchange indirect RAM with ACC

1

1

XCHD A,@Ri

Exchange low order nibble of indirect RAM with
low

1

1

order nibble of ACC

Manipulasi Variabel Boolean

Mnemonic

Deskripsi

Ukuran

Cycle

CLR C

Clear Carry Flag

1

1

CLR bit

Clear direct bit

2

1

SETB C

Set carry flag

1

1

SETB bit

Set direct bit

2

1

CPL C

Compliment carry flag

1

1

CPL bit

Compliment direct bit

2

1

ANL C,bit

AND direct bit to carry flag

2

2

ANL C,/bit

AND compliment of direct bit to carry

2

2

ORL C,bit

AND direct bit to carry flag

2

2

ANL C,/bit

AND compliment of direct bit to carry

2

2

MOV C,bit

Move direct bit to carry flag

2

1

MOV bit,C

Move carry to direct bit

2

2

JC rel

Jump if carry is set

2

2

JNC rel

Jump if carry is not set

2

2

JB bit,rel

Jump if direct bit is set

3

2

JNB bit,rel

Jump if direct bit is not set

3

2

JBC bit,rel

Jump if direct bit is set & clear bit

3

2

Program Percabangan (Branching)

Mnemonic

Deskripsi

Ukuran

Cycle

ACALL addr11

Absolute subroutine call

2

2

LCALL addr16

Long subroutine call

3

2

RET

Return from subroutine

1

2

RETI

Return from Interrupt

1

2

AJMP addr11

Absolute jump

2

2

LJMP addr16

Long jump

3

2

SJMP rel

Short jump (relative address)

2

2

JMP @A+DPTR

Jump indirect relative to the DPTR

1

2

JZ rel

Jump relative if ACC is zero

2

2

JNZ rel

Jump relative if ACC is not zero

2

2

CJNE A,direct,rel

Compare direct byte to ACC and jump if not equal

3

2

CJNE A,#data,rel

Compare immediate byte to ACC and jump if not

equal

3

2

CJNE Rn,#data,rel

Compare immediate byte to register and jump if

not equal

3

2

CJNE @Ri,data,rel

Compare immediate byte to indirect and jump if

not equal

3

2

DJNZ Rn,rel

Decreament register and jump if not zero

2

2

DJNZ direct,rel

Decreament direct byte and jump if not zero

3

2

2 Comments leave one →
  1. tasrif permalink
    October 25, 2009 10:32 pm

    makassih y bozz atas tulisan nya ………
    saya baca dulu intruksi-intruksinya nanti klo saya da yg gak tau tentang intruksi nya saya akan tanya lagi
    sekali lagi saya ucapkan terima kasih

  2. April 20, 2011 8:33 pm

    makasi bozzz
    kbtulan ge perlu ne…instruksi nya…mcs51

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: