Assembly Language Suite software production (1)

Source: Internet
Author: User
Tags final

After the program has been written, it will also be processed into an executable suite of software (Package), generally speaking, even if the program can be executed, there is no error, away from the degree of software package, but there is a distance.
Of course, program debugging is one of the necessary procedures, and sometimes debugging and programming can be done simultaneously. But experienced programmers, with a full understanding of the overall, will often wait until the program joins and then Debug.
After the program is complete debugging, it is best not to rely on the person writing the program. Because programmers are often not users, they are only debugging under their own design conditions. Of course, this error must be corrected, but the most likely error is that the user inadvertently in the input, or the use of instructions, violates the programmer's philosophy. This error occurs, is not forgiven, the program is designed for users, if the user inconvenience, the program loses its due value.
The quality control of the program is whether the test program meets the needs of the user. Generally speaking, there should be a person responsible, but also to write a handbook of people, and do quality control work. This allows you to check the consistency of both the functions and the methods described in the manual.
There is also a common quality control method, which is when the product is finished, to the third party who has not participated in the program design, and makes a comprehensive trial and puts forward the test report or proposal in the objective position.
Quality control is qualified, is the packaging, manuals and other final work. This is not to say that packaging and manuals have to be done in the end, and, in particular, the use of manuals, often at the same time as programming, ready, so that the programmer will not arbitrarily, out of the theme.
The first section tests debugging

No matter what tool you use, you must have a clear mind when you debug, and look at the process and instructions step-by-step according to the way you set it up.
Everyone has a unique habit of error, it is best to write down their mistakes every time, not only the error will gradually reduce, and in the error occurs, it is easy to find.
Test debugging is a very important means, some people think that the first-class programmer should not make mistakes, even if they make mistakes, and very little wrong. My opinion is not the same, not because I often make mistakes, but also wrong. The real reason is that in order to grasp the right direction of thinking, in programming, consciously or unconsciously to ignore some details, so that it can be coherent, not to the exhaustion of three.
This is like drawing, some people like to make sketches first, others are accustomed to drawing from the details. Regardless of individual style, it is important to have the final result.
Before I write a program, I first consider the structure of the whole, and then put the brackets in place, and then consider the common features, and then write it in one breath. and write to be quick, lest lose the feeling at that time. Wait until the structure is largely finished before filling in some less important detail. As for the correct or not, it depends on the test debugging to amend, make up.
This type of writing should have a strong sense of the whole, and the nature and function of each program to understand where to start.
I am from the system program to the application tools, large and small program written a lot of this writing method has a deep understanding. The only drawback is that if the program is too big, more than 20KB, my memory will be hard to bear. (Young people may not be so) but the advantage is that the structure is streamlined and the production time is very short. In our Chinese system program, the 8KB program, even debugging, took only two months.
However, in the course of training the programmer, I found that it is better to step up. Every time you write a program, immediately debug, the program is correct, and then write the next paragraph. Unless there is absolute certainty, confidence there is no problem, or do not wait for all the programs are finished, and then to Debug. By then, if the problem is found, in the intricate procedures of the various sections, to find the wrong place, it is in a haystack.
When the program happens to be "machine", it is often caused by PUSH and pop imbalance, and there is a negative value in the loop when the counter is locked. If there are too many parts of the program, special attention should be paid to the "paragraph" changes.
such as these details, it is best to write the imaginary value of the programming at any time, not too much to believe that their memory, a long time, the program is a big, forget everything.
There is also a point, in the debugging must develop habits, record the tracking process. Because debugging is a very trivial task, it is difficult to find the problem once, the first time should be the experience of the second improvement. It would be a very painful thing to start from scratch every time, if the record is not known.
You might think of debugging as a guessing game, an intellectual challenge that should be fun to follow under certain rules.
Section II Research improvements

To write the program well, we must constantly study, improve, learn from the mistakes, get experience from the improvement, cultivate a keen observation ability and good writing habits.
In the beginning, this process will take a lot of time, but for a programmer, writing a program is a lifelong career, can not improve it?
Here are two examples of how to study improved programs that have been completed.
1, the use of instructions:
In the following communication procedure, not only is the syntax and instructions completely correct, but there is no error in the implementation, can it be improved?
1-1 in accordance with the foregoing, a simplified string has been used in the description item:
snd-transfer rcv-receive let-left
rgt-right ver-straight hor-transverse
1-2 Programmer code Name is ' C '.
1-3 paragraph names are omitted.

1:CSND0:
2:mov DX,03FDH; Output port
3:mov al,80h
4:out Dx,al; Output instructions
5:mov dx,03f8h; LSB speed Control
6:mov al,06h; Speed =19200/seconds
7:out Dx,al
8:mov dx,03f9h; MSB speed Control
9:mov al,0; Speed =19200/seconds
10:out Dx,al
11:mov DX,03FBH; Row Control Register
12:mov al,03h; NO parity,1
; stop,8
13:out Dx,al
14:mov dx,03fch; Communication control
15:out Dx,al
16:mov dx,03f9h; Interrupt Valid
17:mov al,0
18:out Dx,al
19:CSND1:
20:mov DX,03FDH; Status Registers
21:in AL,DX
22:test al,10h; Is it acceptable to receive?
23:JNZ CRCV0; Can
24:test al,20h; Has the channel been cleared?
25:JZ CSND1; 8250 not clear
26:mov ah,1; Does the keyboard have input?
27:int 16H
28:CMP al,07h; = ' Ctrl+g '
29:je cend; Yes, complete.
30:mov dx,03f8h
31:out Dx,al; Send input character

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.