ASCII to BCD conversion subroutine
ASCTOBCD:
MOV R7,# 06H
MOV R1,# 20H
MOV R0,#20H
ACALL ASCBCD
LOOP:
SJMP LOOP
ASCBCD:
MOV A,@R0
CLR C
CJNE A,#30H,LOOP1
LOOP1:
JC C, LOOP3
CJNE A,#3AH,LOOP2
LOOP2:
JNC C, LOOP4
CLR C
SUBB A, # 30H
LOOP3:
MOV X @R1,A.
INC R0
INC R1
DJNZ R7,ASCBCD
RET
LOOP4:
MOV A,#0FFH
MOV X @R1,A
LJMP LOOP3
RET
Previous article:CAN interface assembler
Next article:BCD to ASCII code conversion example
- Popular Resources
- Popular amplifiers
- STC MCU Principles and Applications: Analysis and Design from Devices, Assembly, C to Operating Systems: A Three-Dimensional Tutorial (He Bin)
- 51 MCU Reverse Learning Practical Tutorial
- Introduction to CodeVisionAVR C language library functions
- Omron PLC routine_ASCII Generic Protocol Macro Object Code
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- What are these little triangles for? How do you set them up?
- Automatic gain AGC circuit
- 5 - 65 MHz 24-bit Color FPD-Link II to FPD-Link Converter
- This week's highlights
- How far can the network cable replace the power cable?
- Tesla Model Y will soon release Autopilot or continue to enhance
- Help analyzing non-isolated ACDC circuit
- Xunwei IMX6 development board AndroidStudio-layout test
- [IOT harmful gas detection device based on STM32F7508-DK] Part 1: touchGFX trial
- Free gifts: Aim TTi current measurement probe, professional signal generator, JD card and other small gifts are waiting for you