Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
70
Добавлен:
14.04.2015
Размер:
2.03 Mб
Скачать

64

Chapter 2. Architecture Overview

 

 

Opcode Map

The following opcode maps provide an overview of the instruction encoding for the 8051, the 80C51MX, and the 251 architecture. It is arranged as separate maps as described below:

8051 Instructions: these opcode are available on all x51 variants. Both the 2 Philips 80C51MX and the Intel/Atmel WM 251 use an OPCODE PREFIX byte

with the encoding A5 to extend the classic 8051 instruction set. The additional 251 an 80C51MX instructions are described in the following tables.

Additional 251 Instructions: if the 251 is configured in binary mode the 8051 instructions are the default opcode map and the OPCODE PREFIX is the first opcode byte for the additional 251 instructions. If the 251 is configured in source mode the additional 251 instructions are the default opcode map and the OPCODE PREFIX is the first op-code byte when the 251 should execute standard 8051 instructions that are encode with the byte values x6-xF.

Additional 80C51MX Instructions via Prefix A5: contains the 80C51MX instructions that require the OPCODE PREFIX byte. The Philips 80C51MX provides instructions for addressing the 16MB address space and the extended SFR area that are listed in this table.

Keil Software — A51/AX51/A251 Macro Assembler and Utilities

 

 

65

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8051 Instructions

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Binary

x0

x1

x2

 

x3

x4

x5

x6-x7

x8-xF

 

 

 

Mode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Source

x0

x1

x2

 

x3

x4

x5

A5x6-A5x7

A5x8-A5xF

 

 

 

Mode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

0x

NOP

AJMP

LJMP

 

RR

INC

INC

INC

INC

 

 

adr11

adr16

 

A

A

dir

@Ri

Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1x

JBC

ACALL

LCALL

 

RRC

DEC

DEC

DEC

DEC

 

 

bit,rel

adr11

adr16

 

A

A

dir

@Ri

Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2x

JB

AJMP

RET

 

RL

ADD

ADD

ADD

ADD

 

 

 

bit,rel

adr11

 

A

A,#data

A,dir

A,@Ri

A,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3x

JNB

ACALL

RETI

 

RLC

ADDC

ADDC

ADDC

ADDC

 

 

 

bit,rel

adr11

 

A

A,#data

A,dir

A,@Ri

A,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4x

JC

AJMP

ORL

 

ORL

ORL

ORL

ORL

ORL

 

 

 

rel

adr11

dir,A

 

dir,#data

A,#data

A,dir

A,@Ri

A,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5x

JNC

ACALL

ANL

 

ANL

ANL

ANL

ANL

ANL

 

 

 

rel

adr11

dir,A

 

dir,#data

A,#data

A,dir

A,@Ri

A,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6x

JZ

AJMP

XRL

 

XRL

XRL

XRL

XRL

XRL

 

 

 

rel

adr11

dir,A

 

dir,#data

A,#data

A,dir

A,@Ri

A,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7x

JNZ

ACALL

ORL

 

JMP

MOV

MOV

MOV

MOV

 

 

 

rel

adr11

c,bit

 

@A+DPTR

A,#data

dir,#data

@Ri,#data

Rn,#data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8x

SJMP

AJMP

ANL

 

MOVC

DIV

MOV

MOV

MOV

 

 

 

rel

adr11

C,bit

 

A,@A+PC

AB

dir,dir

dir,@Ri

dir,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

9x

MOV

ACALL

MOV

 

MOVC

SUBB

SUBB

SUBB

SUBB

 

 

 

DPTR,#d16

adr11

bit,c

 

A,@A+DPTR

A,#data

A,dir

A,@Ri

A,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ax

ORL

AJMP

MOV

 

INC

MUL

OPCODE

MOV

MOV

 

 

 

C,/bit

adr11

C,bit

 

DPTR

AB

PREFIX

@Ri,dir

Rn,dir

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bx

ANL

ACALL

CPL

 

CPL

CJNE

CJNE

CJNE

CJNE

 

 

 

C,/bit

adr11

bit

 

C

A,#d8,rel

A,dir,rel

@Ri,#d8,rel

Rn,#d8,rel

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Cx

PUSH

AJMP

CLR

 

CLR

SWAP

XCH

XCH

XCH

 

 

 

dir

adr11

bit

 

C

A

A,dir

A,@Ri

A,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dx

POP

ACALL

SETB

 

SETB

DA

DJNZ

XCHD

DJNZ

 

 

 

dir

adr11

bit

 

C

A

dir,rel

A,@Ri

Rn,rel

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ex

MOVX

AJMP

 

MOVX

CLR

MOV

MOV

MOV

 

 

 

A,@DPTR

adr11

 

A,@Ri

A

A,dir

A,@Ri

A,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fx

MOV

ACALL

 

MOVX

CPL

MOV

MOV

MOV

 

 

 

@DPTR,A

adr11

 

@Ri,A

A

dir,A

@Ri,A

Rn,A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

66

 

 

 

 

 

Chapter 2. Architecture Overview

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Additional 251 Instructions

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Binary

A5x8

A5x9

A5xA

A5xB

A5xC

A5xD

A5xE

A5xF

 

 

 

Mode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Source

x8

x9

xA

xB

xC

xD

xE

xF

 

 

 

Mode

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

0

JSLE

MOV Rm

MOVZ

INC Rm/WRj/

 

 

SRA

 

 

 

Drk,#short

 

 

 

 

 

rel

@WRj+dis

WRj,Rm

 

 

reg

 

 

 

 

MOV reg,ind

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

JSG

MOV@WRj

MOVS

DEC Rm/WRj/

 

 

SRL

 

 

 

 

rel

+dis,Rm

WRj,Rm

Drk,#short

 

 

reg

 

 

 

 

 

 

 

 

MOV ind,reg

 

 

 

 

 

 

 

2

JLE

MOV Rm,

 

 

ADD

ADD

ADD

ADD

 

 

 

rel

@DRk+dis

 

 

Rm,Rm

WRj,WRj

reg,op2

DRk,DRk

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

JG

MOV@DRk

 

 

 

 

SLL

 

 

 

 

rel

+dis,Rm

 

 

 

 

reg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

JSL

MOV Wrj,

 

 

ORL

ORL

ORL

 

 

 

 

rel

@WRjj+dis

 

 

Rm,Rm

WRj,WRj

reg,op2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5

JSGE

MOV@WRj

 

 

ANL

ANL

ANL

 

 

 

 

rel

+ dis,WRj

 

 

Rm,Rm

WRj,WRj

reg,op2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6

JE

MOV Wrj,

 

 

XRL

XRL

XRL

 

 

 

 

rel

@DRk+dis

 

 

Rm,Rm

WRj,WRj

reg,op2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

JNE

MOV @Drk

MOV

 

MOV

MOV

MOV

MOV

 

 

 

rel

+dis,WRj

op1,reg

 

Rm,Rm

WRj,WRj

reg,op2

DRk,DRk

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8

 

LJMP@WRj

EJMP

 

DIV

DIV

 

 

 

 

 

 

EJMP@DRk

addr24

 

Rm,Rm

WRj,WRj

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

9

 

LCALL@WR

ECALL

 

SUB

SUB

SUB

SUB

 

 

 

 

ECALL@DRk

addr24

 

Rm,Rm

WRj,WRj

reg,op2

DRk,DRk

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A

 

BIT

ERET

 

MUL

MUL

 

 

 

 

 

 

instructions

 

Rm,Rm

WRj,WRj

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B

 

TRAP

 

 

CMP

CMP

CMP

CMP

 

 

 

 

 

 

Rm,Rm

WRj,WRj

reg,op2

DRk,DRk

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

PUSH

 

 

 

 

 

 

 

 

 

 

op1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D

 

 

POP

 

 

 

 

 

 

 

 

 

 

op1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Keil Software — A51/AX51/A251 Macro Assembler and Utilities

 

67

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Additional 80C51MX Instructions via Prefix A5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A5x0

A5x1

A5x2

A5x3

A5x4

A5x5

A5x6-A5x7

A5x8-A5xF

A5x8-A5xF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x

 

 

EJMP

 

 

INC

 

 

 

 

 

 

 

 

adr23

 

 

esfr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

1x

JBC

 

ECALL

 

 

DEC

 

 

 

 

 

esbit,rel

 

adr23

 

 

esfr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2x

JB

 

 

 

 

ADD

 

 

 

 

 

esbit,rel

 

 

 

 

A,esfr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3x

JNB

 

 

 

 

ADDC

 

 

 

 

 

 

esbit,rel

 

 

 

 

A,esfr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4x

 

 

ORL

ORL

 

ORL

 

EMOV

EMOV

 

 

 

 

 

 

 

A,@PR0+d2

 

 

 

 

 

esfr,A

esfr,#data

 

A,esfr

 

A,@PR1+d2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5x

 

 

ANL

ANL

 

ANL

 

EMOV

EMOV

 

 

 

 

 

esfr,A

esfr,#data

 

A,esfr

 

@PR0+d2,A

@PR1+d2,A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6x

 

 

XRL

XRL

 

XRL

 

ADD

ADD

 

 

 

 

 

esfr,A

esfr,#data

 

A,esfr

 

PR0,#data2

PR1,#data2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7x

 

 

ORL

EJMP

 

MOV

 

 

 

 

 

 

 

 

c,esbit

@A+EPTR

 

dir,#data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8x

 

 

ANL

 

 

MOV

MOV

MOV

 

 

 

 

 

C,esbit

 

 

esfr,esfr

esfr,@Ri

esfr,Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

9x

MOV

 

MOV

MOVC

 

SUBB

 

 

 

 

 

 

EPTR,#d23

 

esbit,c

A,@A+EPTR

 

A,esfr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ax

ORL

 

MOV

INC

 

 

MOV

MOV

 

 

 

C,/esbit

 

C,esbit

EPTR

 

 

@Ri,esfr

Rn,esfr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bx

ANL

 

CPL

 

 

CJNE

 

 

 

 

 

 

C,/esbit

 

esbit

 

 

A,esfr,rel

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Cx

PUSH

 

CLR

 

 

XCH

 

 

 

 

 

 

esfr

 

esbit

 

 

A,esfr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dx

POP

 

SETB

 

 

DJNZ

 

 

 

 

 

 

esfr

 

esbit

 

 

esfr,rel

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ex

MOVX

 

 

 

 

MOV

 

 

 

 

 

 

A,@EPTR

 

 

 

 

A,esfr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fx

MOV

 

 

 

 

MOV

 

 

 

 

 

 

@EPTR,A

 

 

 

 

esfr,A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

68

Chapter 2. Architecture Overview

 

 

2

Соседние файлы в папке HLP