Asembbly Operation & Sintax Program Arithmetic Operations Mnemonic Description Bytes Cycles

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

ASEMBBLY OPERATION & SINTAX PROGRAM ARITHMETIC OPERATIONS Mnemonic ADD A,Rn ADD A, direct ADD A,@Ri ADD

A,#data ADDC A,Rn ADDC A,direct ADDC A,@Ri ADDC A,#data SUBB A,Rn SUBB A,direct SUBB A,@Ri SUBB A,#data INC A INC Rn INC direct INC @Ri DEC A DEC Rn DEC direct DEC @Ri INC DPTR MUL AB Description Add register to A Add direct byte to A Add indirect RAM to A Add immediate data to A Add register to A with Carry Add direct byte to A with Carry Add indirect RAM to A with Carry Add immediate data to A with Carry Subtract register from A with Borrow Subtract direct byte from A with Borrow Subtract indirect RAM from A with Borrow Subtract immediate data from A with Borrow Increment A Increment register Increment direct byte Increment indirect RAM Decrement A Decrement register Decrement direct byte Decrement indirect RAM Increment Data Pointer Multiply A & B (A x B => BA) 2 1 1 1 1 2 1 2 1 1 2 1 1 1 1 1 2 4 Bytes 1 2 1 2 1 2 1 2 1 1 1 1 1 1 1 1 1 1 Cycles 1 1 1 1 1 1 1 1

DIV AB DA A

Divide A by B (A/B => A + B) Decimal Adjust A

1 1

4 1

LOGICAL OPERATIONS Mnemonic ANL A,Rn ANL A,direct ANL A,@Ri ANL A,#data ANL direct,A ANL direct,#data ORL A,Rn ORL A,direct ORL A,@Ri ORL A,#data ORL direct,A ORL direct,#data XRL A,Rn XRL A,direct XRL A,@Ri XRL A,#data XRL direct,A XRL direct,#data CLR A CPL A Description AND register to A AND direct byte to A AND indirect RAM to A AND immediate data to A AND A to direct byte AND immediate data to direct byte OR register to A OR direct byte to A OR indirect RAM to A OR immediate data to A OR A to direct byte OR immediate data to direct byte Exclusive-OR register to A Exclusive-OR direct byte to A Exclusive-OR indirect RAM to A Exclusive-OR immediate data to A Exclusive-OR A to direct byte Exclusive-OR immediate data to direct byte Clear A Complement A 1 Bytes 1 2 1 2 2 3 1 2 1 2 2 3 1 2 1 2 2 3 1 1 Cycles 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1

RL A RLC A RR A RRC A SWAP A

Rotate A Left Rotate A Left through Carry Rotate A Right Rotate A Right through Carry Swap nibbles within A 1

1 1 1 1 1

1 1 1

DATA TRANSFER Mnemonic MOV A,Rn MOV A,direct MOV A,@Ri MOV A,#data MOV Rn,A MOV Rn,direct MOV Rn,#data MOV direct,A MOV direct,Rn MOV direct,direct MOV direct,@Ri MOV direct,#data MOV @Ri,A MOV @Ri,direct MOV @Ri,#data MOV DPTR,#data16 MOVC A,@A+DPTR Description Move register to A Move direct byte to A Move indirect RAM to A Move immediate data to A Move A to register Move direct byte to register Move immediate data to register Move A to direct byte Move register to direct byte Move direct byte to direct byte Move indirect RAM to direct byte Move immediate data to direct byte Move A to indirect RAM Move direct byte to indirect RAM Move immediate data to indirect RAM Load Data Pointer with 16-bit constant Move Code byte relative to DPTR to A 2 1 2 3 2 3 1 2 2 2 1 2 2 2 2 1 2 1 1 2 2 1 1 2 1 2 2 1 1 1 2 1 Bytes Cycles 1 1

MOVC A,@A+PC MOVX A,@Ri MOVX A,@DPTR MOVX @Ri,A MOVX @DPTR,A PUSH direct POP direct XCH A,Rn XCH A,direct XCH A,@Ri XCHD A,@Ri

Move Code byte relative to PC to A Move External RAM (8-bit addr) to A Move External RAM (16-bit addr) to A Move A to External RAM (8-bit addr) Move A to External RAM (16-bit addr) Push direct byte onto stack Pop direct byte from stack Exchange register with A Exchange direct byte with A Exchange indirect RAM with A Exchange low-order Digit indirect RAM with A

1 1 1 1 1 2 2 1 2 1 1

2 2 2 2 2 2 2 1 1 1 1

BOOLEAN VARIABLE MANIPULATION Mnemonic CLR C CLR bit SETB C SETB bit CPL C CPL bit ANL C,bit ANL C,/bit ORL C,bit ORL C,/bit MOV C,bit MOV bit,C Description Clear Carry flag Clear direct bit Set Carry flag Set direct bit Complement Carry flag Complement direct bit AND direct bit to Carry flag AND complement of direct bit to Carry flag OR direct bit to Carry flag OR complement of direct bit to Carry flag Move direct bit to Carry flag Move Carry flag to direct bit 1 Bytes Cycles 1 2 1 2 1 2 2 2 2 2 2 2 1 2 2 2 2 1 2 1 1 1 1

PROGRAM AND MACHINE CONTROL Mnemonic ACALL addr11 LCALL addr16 RET RETI AJMP addr11 LJMP addr16 SJMP rel JMP @A+DPTR JZ rel JNZ rel JC rel JNC rel JB bit,rel JNB bit,rel JBC bit,rel CJNE A,direct,rel CJNE A,#data,rel CJNE Rn,#data,rel CJNE @Ri,#data,rel DJNZ Rn,rel DJNZ direct,rel NOP Description Absolute subroutine call Long subroutine call Return from subroutine Return from interrupt Absolute Jump Long Jump Short Jump (relative addr) Jump indirect relative to DPTR Jump if A is Zero Jump if A is Not Zero Jump if Carry flag is set Jump if No Carry flag Jump if direct Bit is set Jump if direct Bit is Not set Jump if direct Bit is set & Clear bit Compare direct to A & Jump if Not Equal Compare immediate to A & Jump if Not Equal Compare immed. to reg. & Jump if Not Equal Compare immed. to ind. & Jump if Not Equal Decrement register & Jump if Not Zero Decrement direct byte & Jump if Not Zero No operation 2 2 Bytes Cycles 2 3 1 1 2 3 2 1 2 2 2 2 3 3 3 3 3 3 3 2 3 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2

Notes on data addressing modes Rn direct @Ri #data #data16 bit Working register R0-R7 128 internal RAM locations, any I/O port, control or status register Indirect internal RAM location addressed by register R0 or R1 8-bit constant included in instruction 16-bit constant included in instruction 128 software flags, any I/O pin, control or status bit

Notes on program addressing modes addr16 Destination address may be anywhere in 64-kByte program address space addr11 Destination address will be within same 2-kByte page of program address space as first byte of the following instruction rel 8-bit offset relative to first byte of following instruction (+127, -128)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy