The art of assembly language-preparation work (IV.)

Source: Internet
Author: User

Second, the original file (source file) file name definition

When designing large modules together, the tacit understanding between programmers depends on mutual agreement. Otherwise, the larger the program, the more difficult it will be, often time-consuming, or even a final failure.
Therefore, at the beginning of design, it is necessary to properly plan and define the files, names and functions of reprehensible. The programmer who participates in the design, must strictly obey, can be handy.
The original file name is defined for three purposes:
1, on behalf of the programmer: when the production of the program is very long, a see file name, you should be able to distinguish the design of each program. If a programmer has programmed more than one, it should add a number after the code. In this way, if you have any problems, you can immediately find a place to follow.

2, representing the program function: Whenever the problem occurs after the connection, should be able to check the file name of the problem, so each function should be given the appropriate name.

3, the relationship between the representatives: in addition to the function, sometimes must indicate the relationship between the programs. If a program must be arranged before or after another program, it should also be at the end of the filename, in the order of numbers.
If there are no more than 20 programmers involved, the first character of the file name is limited to one letter, each of whom is selected in advance. The second character, depending on whether the programmer has written more than one program, is a number representing it, if not.
Function of three to six characters appropriate, can be unified length will be more convenient, the remaining one word for a number of orders.
Example: The programmer code-named ' C ', the program is numbered 3, the function is ' draws ', in addition, there is no connection, the name should be:
Cdraws3.asm

Iii. Definition of Title

When the program is sorted or tested, the biggest trouble is finding the source or function of a particular title. If in the same file, you can use Cref.exe to print out a table; If you do not know which file, in many programs, there is only exclaiming.
As for functions, such as the name set too long, not only input, modify inconvenience, but also make the program appears to be messy, it is dazzling. It is difficult to understand if they are set too simply or arbitrarily named by each individual.
Therefore, the title of the importance of naming, not the writing of the program. Especially in the large number of participants, the title should not only be unified, but also to represent all the necessary information.
The message represented by the title is:
A x x x x x x × x x
│└┬┘└┬┘└── Branch Code
││└──── extension Definition
│└─────── function name
└───────── program Source

1, the Source: If a lot of people participate in a program at the same time, and a programmer only wrote a program, this definition is the programmer's code. Otherwise, the number should be appended so that it can be traced at any time. Even if there is only one person writing program, the program may continue to expand, for the convenience of production, or for module segmentation, it is often necessary to divide the program into other files. Therefore, the exact file in which a program originated, all depends on the title, so that it can be found quickly.
The source of the program is usually a letter, as the first letter a indicates that the program came from the original file numbered a, or a program that is a code programmer with a.

2, Function name: In addition to a number of known functions can be defined in advance, the rest is mostly in the development process, for the needs of the production. Do not take lightly the definition of a function, the reuse value of a program is often closely related to its functional definition, clearly defined, it can make a clear understanding of its function and the way of application.
The function name length is three letters advisable, is too long to enter the time consuming, especially the Chinese not all have the English to be good, rather than writes wrong, inferior Zang.
Such as: DSP represents the screen display function
PRN indicates the printing function
KIN represents keyboard input function

3, extension definition: If the function of the same program too much, 2, the definition in the way difficult to distinguish, you can add an extension definition.
such as: Dspdot representation display dot matrix
Prnchi says print Chinese
KINASC represents the ASCII character input

4, the Branch code: in the program often branch, the branch code is ideal by small and large, arranged sequentially. But because writing is often difficult to predict the situation, it is advisable to leave the number first, so as to expand.
such as: DSPDOT10
PRNCHI06
KINASC24

Four, the buffer definition

B x x x x x x × X
││└┬┘└┬┘
│││└─── extension Definition
││└────── function name
│└──────── type
└───────── buffer reserved word

The first letter stipulates ' B ', which preserves the word for the buffer.
The second letter defines its type:
Q=qword such as: bqxxxx buffer length of 8 characters.
D=dword such as: bdxxxx length is 4 characters.
W=word such as: bwxxxx length is 2 characters.
B=byte such as: bbxxxx length is 1 characters.
S=string such as: bsxxxx unlimited length, but limited to byte type.
O=original such as: Boxxxx table can not destroy the original data.
F=flag such as: Bfxxxx used as a banner.
The function or extension defined after the second letter is the same as the third or 2,3. In addition, all buffers should be uniformly located in the buffer-specific program, if temporarily used, or not yet formally connected, should also be located at the top of the program, so as to facilitate inspection, modification.

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.