51 MCU division instruction (1) with example

Publisher:浅唱梦幻Latest update time:2017-10-16 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The function of this instruction is to divide the 8-bit unsigned integer in accumulator A by the 8-bit unsigned integer in register B. The quotient is stored in accumulator A, and the remainder is stored in register B. The division operation always makes OV and the carry flag CY equal to 0. If OV=1, indicating that the content in register B is 00H, then the execution result is an indeterminate value, indicating that the division has overflowed.

DIV AB; (A) ÷ (B) → (A) and (B) The content in accumulator A is divided by the content in register B. The quotient is stored in accumulator A, and the remainder is stored in register B.



For example: 13/5, the quotient is 2 and the remainder is 3. After the division, the quotient is placed in A and the remainder is placed in B, and CU and OV are both 0. If the value in B is 00H before the division, that is, the divisor is 0, then OV=1.


Reference address:51 MCU division instruction (1) with example

Previous article:51 MCU plus 1 instruction (5 instructions) Example
Next article:51 MCU multiplication instruction (1)

Latest Microcontroller Articles
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号