Analysis of various arithmetic operation instructions of single chip microcomputer

Publisher:闪耀的星空Latest update time:2020-06-09 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Addition (impact on C, AC, OV, etc.)

ADD A, Rn---(@Ri, direct, #data)

ADDC ------------------------------------------


2. Subtraction

SUBB A,------------------------------------


3. Add 1 (does not affect the flag bit)

INC A (Rn, @Ri, direct, DPTR)

"Read-modify-write" instructions for port Pi : INC, DEC, ANL, ORL, XOR, DJNZ

Analysis of various arithmetic operation instructions of single chip microcomputer

4. Subtract 1-------

DEC A (Rn, @Ri, direct)


5. Decimal Addition Adjustment

D A


6. Multiplication

MUL AB When the product is greater than 255, OV=1


7. Division

DIV AB When divisor=0, OV=1

Keywords:MCU Reference address:Analysis of various arithmetic operation instructions of single chip microcomputer

Previous article:The function of the microcontroller external interrupt line
Next article:Processing of Chinese Characters by Single Chip Microcomputer VB6

Recommended ReadingLatest update time:2024-11-16 08:39

The execution process of 16-bit data transfer instructions of 89C51 microcontroller
16-bit data transfer instruction (1) This is the only 16-bit immediate data transfer instruction of the 89C51 microcontroller. Its function is to send a 16-bit immediate data into the data pointer DPTR. The upper 8 bits are sent to DPH and the lower 8 bits are sent to DPL. MOV DPTR, #data16; #dataH→ (DPH), #dataL→ (
[Microcontroller]
The execution process of 16-bit data transfer instructions of 89C51 microcontroller
51 single chip microcomputer direct addressing and indirect addressing
The addressing mode that directly gives the operand address (dir) in the instruction is called direct addressing. The addressing objects are: 1 internal data memory, which is represented by a direct address in the instruction; 2 special function registers SFR, which are represented by register names in the instruction
[Microcontroller]
12 Things to Note on Program Optimization of Eight-bit MCU
1. Use short variables One of the most basic ways to improve code efficiency is to reduce the size of variables. When programming in C, we are all accustomed to using the int type for loop control variables. This is a huge waste for an 8-bit microcontroller. You should carefully consider the possible range of variable
[Microcontroller]
89c52 independent button of single chip microcomputer-----study notes
1. Button Introduction A touch switch is an electronic switch. Use: Press the switch button to connect the circuit, release it, and the switch will be disconnected 2. Working principle of independent switch When the key is opened and closed, the contacts will vibrate. P0 port: In order to achieve three-state, OC
[Microcontroller]
89c52 independent button of single chip microcomputer-----study notes
Small household appliances are facing difficulties due to chip shortage. What are the opportunities for domestic MCU replacement?
MCU and other materials prices rise, domestic small home appliance industry elimination competition accelerates Since the outbreak of the epidemic, the large home appliance market has been sluggish, the small home appliance market has been flat, and only the small home appliance online market has maintained a differen
[Mobile phone portable]
Design of frequency measurement module circuit using microcontroller as core
introduction With the development and popularization of radio technology, "frequency" has become a physical quantity familiar to the general public. The emergence of microcontrollers has brought many major leaps to various measurement technologies, including frequency measurement. However, the advantages of small size
[Microcontroller]
Design of frequency measurement module circuit using microcontroller as core
IAR fully supports Silergy SA32 series automotive MCU
IAR embedded development solutions now fully support Silergy SA32BXX series automotive ASIL-B MCUs and the upcoming SA32DXX series ASIL-D MCUs, jointly promoting the development of high-quality automotive applications Shanghai, China, June 26, 2024 - IAR, a leading global provider of embedded syst
[Automotive Electronics]
IAR fully supports Silergy SA32 series automotive MCU
51 MCU outputs 3-way PWM to drive RGB LED source program
Use the microcontroller interrupt to process PWM, control the ordinary three-color LED, output seven different colors, and change with breathing. It does not take up the program running time.    The microcontroller source program is as follows:                          }                                         else
[Microcontroller]
51 MCU outputs 3-way PWM to drive RGB LED source program
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号