Assembly language is the fastest and most effective language that computers can provide to users. It is also the only language that can use all the hardware features of the computer and can directly control the hardware. Therefore, the application of assembly language is indispensable for applications where space and time are very high. As for many applications that require direct control of the hardware, it is not necessary to use assembly language.
As an important basic course in computer science and related disciplines, its importance is self-evident. But for many beginner assembly language people, they are generally more difficult and difficult to understand and master. It is difficult to get started, watching the wrong program, but also do not know where to change, this article is mainly introduced microcontroller assembly language common mistakes Knowledge point of analysis, specific follow Xiaobian to understand.
Analysis of Common Mistakes in Microcontroller Assembly LanguageOne, MAS51 assembly software failure analysis
MCU assembly language to pay attention to a certain grammar, details can refer to the relevant reference books, grammatical mistakes will cause assembly failure, the common compilation error is as follows:
1, label repeat is common in the copy and paste program forget to modify the label, resulting in a number of the same label, the label is not allowed to repeat.
2. The punctuation marks are entered in the full-angle mode. The MAS51 program requires the punctuation marks to be half-width, otherwise the assembly fails. You can switch to half-width mode when you enter :,; or enter punctuation characters in uppercase, which is an error that is easy to make and not easy to detect.
3. The comment is too long. Sometimes, in order to read the program later, a long comment is written. When the stationmaster discovers that more than 20 men, it will also cause compilation failure. The solution can divide the long comment into multiple comments.
4. The value 0 is missing before #FFH, and 0 should be added before a~f according to the requirement and written as #0FFH.
5. The letter O and the number 0 are mixed. Sometimes the two words look exactly the same, so be careful.
6, after the label missing ":"
7, the use of special characters labels, such as: T1, T2, A, B these characters have a specific meaning, not allowed for labeling.
8, AJMP jump more than 2K address, AJMP is a short jump command, there is a limit of 2K address range.
9, JB P3.2, EXIT jump more than -128 ~ 127 address range. This is the most likely mistake! You may be able to compile and compile successfully just now. After you add a program, the program will prompt an error. You can convert JB P3.2, EXIT to JNB P3.2, UUUAJMP EXITUUU:
10. The confusion between the letter I and the number 1, the common problem of the daredevil.
11. Creation of an assembly-language instruction that does not exist in the invention. This innovation may not be welcomed during the process of writing the program. This instruction assembly program does not support it, and the chip does not recognize it.
12. The symbol ":" ";" is best written in half angle.
Using assembly software FAQs:
1, if the assembly software appears ** Unrecongnized Command ** prompt words indicate assembly command input error. The correct assembler command is asm51 d:01.txt Note that asm51 should be followed by a space.
2, if the assembly software appears **Dos File I/O error ** prompt words indicate that the assembly file path error. The first thing to notice is that the Chinese name cannot appear in the installation path of the MASM51 software. For example, the assembly software is installed under the D: single-chip microcomputer, and the Chinese name of the second file to be assembled cannot appear in the path, for example, D: 01.TXT. When the file suffix is ​​not asm, the suffix cannot be omitted.
Second, the program error1, register repeatedly called:
For example, if R4=5 is set in the main program, it means that the main program loops 5 times, and one of the delay subroutines also uses R4 to make the value of R4 disorder and cause the program to fail to execute normally.
2, the hardware is not familiar with:
SCM generally use pull-down output, often port output 0 drive peripheral work, and common positive logic is opposite, easy to make mistakes.
Third, the command 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 register R0 ~ R7, n = 0 ~ 7.
(3) @Ri: Register Ri indirectly addresses 8-bit memory locations 00H to FFH.
(4) Direct: 8-bit direct address, which can be 80H to FFH of the internal RAM 00H to 7FH or SFR.
(5) #data: 8-bit immediate data.
(6) #data16: 16-bit immediate data.
(7) addr16: 16-bit destination address. Used for LCALL and LJMP instructions that can be called or moved anywhere in the 64K program memory space.
(8) addr11: 11-bit destination address. Used for ACALL and AJMP instructions that can be called or transferred within the 2K byte page where the next instruction address is located.
(9) rel: Signed 8-bit offset address for SJMP and all conditional branch instructions. The range is -128 to +127 bytes relative to the address of the first byte of the next instruction.
(10) DPTR: A data pointer that can be used as a 16-bit address register.
(11) bit: bit address. Bit-addressable on-chip RAM and addressable bits in the SFR.
(12) A: Accumulator Acc.
(13) B: General-purpose register, mainly used for multiplication MUL and division DIV instructions.
(14) Cy: Carry flag or accumulator in Boolean processor.
(15) @: The prefix of the indirect register or base register. Such as @Ri, @DPTR, @A+PC, @A+DPTR.
Multi-core cpu is more and more popular, people are used to take dual core processors laptop before. However, Quad Core Laptop is becoming selling like a hot cake nowadays. You can find Quad Core Processor Laptop at our store, like I3 Quad Core Laptop,I7 Quad Core Laptop, I5 Quad Core Laptop, intel celeron J4125 or N5095 15.6 Inch Laptop, even N4120 quad core 14 Inch Laptop, etc. Therefore, you can just share the parameters prefer, like size, cpu, ram, rom, gpu, application scenarios, thus save much time to get a win-win solution.
Do you know the reason why more people choose quad core device? The core reason is that heavier tasks people need to finish at a higher speed than before. Nowadays quick rhythm is becoming the main style in city even everyone is eager to downshifting. So more powerful laptop, computer, mobile phone is a trend, though most functions never are used in lifetime.
15.6 inch Gaming Laptop or 14 Inch Gaming Laptop is becoming the most popular level at the market.
Quad Core Laptop,I3 Quad Core Laptop,I7 Quad Core Laptop,I5 Quad Core Laptop,Quad Core Processor Laptop
Henan Shuyi Electronics Co., Ltd. , https://www.shuyilaptop.com