MCS-51 program to find the number of identical numbers

Publisher:灵感之翼Latest update time:2018-03-10 Source: eefocusKeywords:MCS-51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere


  
  Find out how   many bytes are zero in 2000~200FH, and put the number of zeros in 2100H.

001

 

ORG 0AA0H

0AA0 7810 L5800: MOV R0,#10H ;Search 16 bytes

0AA2 7900 MOV R1,#00H

0AA4 902000 MOV DPTR,#2000H

0AA7 E0 L5811: MOVX A,@DPTR

0AA8 B40001 CJNE A,#00H,L5816;Is the retrieved content equal to 00H?

0AAB 09 INC R1 ; add 1 to the number of items taken out

0AAC A3 L5816: INC DPTR

0AAD D8F8 DJNZ R0,L5811 ;To be continued

0AAF 902100 MOV DPTR,#2100H

0AB2 E9 MOV A,R1

0AB3 F0 MOVX @DPTR,A ; send 2100H for the same number

0AB4 80FE L581E: SJMP L581E

END


Keywords:MCS-51 Reference address:MCS-51 program to find the number of identical numbers

Previous article:P1.0 Turning Light Program
Next article:Interface and programming of 89C52 and HD7279A

Recommended ReadingLatest update time:2024-11-16 15:29

MCS-51 MCU Timer/Counter Basics
The MCS-51 sub-series microcontroller has two timer/counters, namely timer/counter 0 and 1. In addition to the above two timer/counters, the 52 sub-series microcontroller (8032/8052) also has a timer/counter 2, which has stronger functions than the previous two. 1 Timer/Counter 0 and 1 In the dedicated register TM
[Microcontroller]
MCS-51 MCU Timer/Counter Basics
MCS-51 series MCU bit transfer instructions (2 instructions)
Boolean processing is an important feature of the MCS-51 series of microcontrollers, which is set up for practical application needs. Boolean variables are also switch variables, which are operated in bits. In terms of physical structure, the MCS-51 microcontroller has a Boolean processor that uses the carry flag a
[Microcontroller]
MCS-51 MCU Practical Subroutine Library (IV)
(II) MCS-51 floating point operation subroutine library and its usage instructions This floating point subroutine library has three different versions to suit different applications: 1. Small library (FQ51A.ASM): contains only floating point addition, subtraction, multiplication and division subroutines. 2. Medium li
[Microcontroller]
Design of Serial Communication between PC and Multiple MCS-51 Single-Chip Microcomputers
1 Introduction In measurement and control systems and engineering applications, it is common to encounter situations where multiple tasks need to be executed simultaneously, so the master-slave multi-machine distributed system has become a widely used model in modern industry. Most of them are composed of IBM-PC micr
[Microcontroller]
Design of Serial Communication between PC and Multiple MCS-51 Single-Chip Microcomputers
MCS-51 MCU input and output ports (I/O ports)
Another major feature of the microcontroller chip is the parallel I/O port. MCS-51 has four 8-bit parallel I/O ports, denoted as P0, P1, P2, and P3. Each port contains a latch, an output driver, and an input buffer. In fact, they have been classified as special registers and have byte addressing and bit addressing fun
[Microcontroller]
MCS-51 MCU input and output ports (I/O ports)
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号