EasyManuals Logo

Atmel 8051 User Manual

Atmel 8051
113 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #36 background imageLoading...
Page #36 background image
The 8051 Instruction Set
1-35 Atmel 8051 Microcontrollers Hardware Manual
4316B–8051–02/04
1.14.13 DECbyte
Function: Decrement
Description: DEC byte decrements the variable indicated by 1. An original value of 00H underflows to 0FFH. No flags are
affected. Four operand addressing modes are allowed: accumulator, register, direct, or register-indirect.
Note: When this instruction is used to modify an output port, the value used as the original port data will be read
from the output data latch, not the input pins.
Example: Register 0 contains 7FH (01111111B). Internal RAM locations 7EH and 7FH contain 00H and 40H, respectively.
The following instruction sequence,
DEC @R0
DEC R0
DEC @R0
leaves register 0 set to 7EH and internal RAM locations 7EH and 7FH set to 0FFH and 3FH.
DEC A
Bytes: 1
Cycles: 1
Encoding: 00010100
Operation: DEC
(A) (A) - 1
DEC R
n
Bytes: 1
Cycles: 1
Encoding: 00011r r r
Operation: DEC
(R
n
) (R
n
) - 1
DEC direct
Bytes: 2
Cycles: 1
Encoding: 00010101 direct address
Operation: DEC
(direct) (direct) - 1
DEC @R
i
Bytes: 1
Cycles: 1
Encoding: 0001011 i
Operation: DEC
((R
i
)) ((R
i
)) - 1

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atmel 8051 and is the answer not in the manual?

Atmel 8051 Specifications

General IconGeneral
BrandAtmel
Model8051
CategoryMicrocontrollers
LanguageEnglish

Related product manuals