Share some common syntax and program errors in MCU assembly language

First, assembly software assembly failure reasons analysis Here using the Keil C51 software package macro assembler A51 as a compiler, MCU assembly language should pay attention to certain grammar when writing, detailed introduction can refer to the relevant reference books, grammar errors will cause assembly Failure, common assembly errors are as follows:
1. Repeating labels: It is common to forget to modify the label when copying and pasting the program, causing multiple identical labels to appear. The labels are not allowed to be repeated.
2. Punctuation is entered in full-width mode: The assembler requires punctuation in half-width mode, otherwise assembly fails. You can switch to half-width mode when you type:,; or enter punctuation in uppercase, which is a mistake that is easy to make and not easy to detect.
3. Value #FFH before omission 0: According to the requirement, add 0 before a~f, write #0FFH
4. The letter O and the number 0 are confused: Sometimes these two words look exactly the same, pay attention to ~~
5. Missing ":" after the label
6. The label uses special characters: The label cannot use the instruction mnemonic, pseudo instruction, special function register name and "#", "@" used in the command system of 8051, the length is 2~6 characters, the first The letters must be English letters. For example, the characters T1, T2, A, and B have specific meanings and are not allowed for labels.
7. AJMP jumps over 2K address: AJMP is a short jump command with a 2K address range limit.
8. Exceeded address range: JB P3.2, EXIT jumps over -128 to 127 address ranges. This is the most prone error! You may be able to compile and compile successfully. If you add a program, the program will prompt an error. You can convert JB P3.2, EXIT to JNB P3.2, LD01 AJMP EXIT. LD01: AJMP EXIT ......
9. The letter I and the number 1 are confused: The common problem of daredevil.
10. Create an assembly language instruction that does not exist in the invention: This innovation is not welcome in the process of writing a program. This instruction assembler does not support it, and the chip does not recognize it.
11. The symbol ":" ";" is best written in half-width.
Share some common syntax and program errors in MCU assembly language
Second, the program is wrong
1. Register repeated call: For example, R4=5 is set in the main program, which means that the main program loops 5 times, and one of the delay subroutines uses R4, which makes the value of R4 disorder, causing the program to fail to execute normally. .
2. Unfamiliar hardware: The single-chip microcomputer generally uses pull-down output, and often the port output 0 drives the peripheral work. Contrary to the common positive logic, it is easy to make mistakes.
Third, the instruction system commonly used symbols and meanings
(1) Ri: Working register 0 and working register 1, i=0 or 1. That is, R0~R1.
(2) Rn: Working registers R0 to R7, n=0 to 7.
(3) @Ri: Register Ri indirectly addresses 8-bit memory cells 00H to FFH.
(4) direct: 8-bit direct address, which can be 80H to FFH of internal RAM 00H to 7FH or SFR.
(5) #data: 8-bit immediate.
(6) #data16: 16-bit immediate.
(7) addr16: 16-bit destination address. Used for LCALL and LJMP instructions, can be called or transferred anywhere in the 64K program memory space. (8) addr11: 11-bit destination address. Used for ACALL and AJMP instructions, which can be called or transferred within the 2K byte page where the next instruction address is located.
(9) rel: A signed 8-bit offset address for SJMP and all conditional branch instructions. The range is -128 to +127 bytes with respect to the address of the first byte of the next instruction.
(10) DPTR: Data pointer, which can be used as a 16-bit address register.
(11) bit: bit address. Bit addressable in on-chip RAM and addressable bits in SFR.
(12) A: Accumulator Acc.
(13) B: General purpose registers, mainly used in multiplication MUL and division DIV instructions.
(14) Cy: Carry flag or accumulator in the Boolean processor.
(15) @: The prefix of the indirect register or base register. Such as @Ri, @DPTR, @A+PC, @A+DPTR. The advice of writing assembly language should develop good programming habits, such as label alignment, parameter alignment, and annotation alignment, which are pleasing to the eye and not easy to make mistakes. The label is preferably in meaningful English, which is more intuitive, the annotation is as detailed and accurate as possible, easy to read later, and is useful for calling as a subroutine module in other programs. Also pay attention to the accumulation of typical program modules, and then the complex program is also composed of a small program module, in the initial stage can be written for typical programs such as: delay subroutine, table lookup subroutine, button debounce subroutine, etc. Practice once, so impressed, easy to quote later.

Capacitor Leakage Test Power Supplies

The ADP series capacitor leakage test power supply is specially designed and customized for capacitor manufacturers` product quality control process or users of capacitors for capacitor ripple current durability life test.


Adp Capacitor Leakage Test Power Supply With Timer


The output of the capacitor leakage test power supply is composed of a set of adjustable DC output and a set of adjustable AC output, which needs to be calculated by our internal spread sheet according to the parameters of the capacitors under test to work out the required LC parameter of the power supply for each capacitors` leakage current test, the matched LC part can then match the parameters of the capacitors under test to generate a sine AC that meets the requirements, and form a controllable AC/DC superimposed output with another set of DC outputs.

Capacitor leakage current test power supply is aimed at the diversity of output voltage and frequency required for different capacitance tests with the DC output voltage up to 3000Vdc, the AC voltage output up to 200Vac, the AC current up to 500A, and the output frequency can be selected according to customer requirements from 50Hz to 100KHz.
Equipped with special high-frequency and high-temperature fixtures and connecting wires for capacitor leakage current testing, the capacitor leakage current test power supply can imitate the actual working conditions of capacitors to determine the service life of a group of capacitors under test, providing the accurate parameters of capacitors required by the manufacturer for the capacitors R&D and quality inspection test, the power supply is now aiding the test of high-frequency and high-current passive devices such as high-frequency capacitors, film capacitors, electrolytic capacitors, ballast capacitors, and ballast inductors.

Capacitor Leakage Current Power Supplies, Leakage Current Ripple Power Supplies, AC and DC Power Supplies, Capacitor Test Power Supplies, Ripple Current Test Power Supplies

Yangzhou IdealTek Electronics Co., Ltd. , https://www.idealtekpower.com