-
code segment ;Segment definition begins.
assume cs:code ;The code segment is specified as the ** segment.
start: ;The location where the program starts execution (specified by end start) begin: mov ah,1; The function number of int 21h. The function number is: Keyboard input function.
int 21h ;Keyboard input.
cmp al,'a' ;al=keyboard input symbol, it is the same as'a'to compare.
jb stop ;If al<'a', go to stopcmp al,'z' ;al=keyboard input symbol, it is the same as'z'to compare.
ja stop ;If al<'z', then go to stopsub al, 20h; Lowercase letters are changed to uppercase letters.
mov dl,al ;al is assigned to dl, in order to display.
mov ah,2 ;The function number of int 21h. The function number is: Displays the value of DL.
int 21h ;Displays the value of DL.
jmp begin ;Loop, i.e. enter the next symbol.
stop: ;If the keyboard is not typing lowercase letters, skip here.
mov ah,4ch ;The function number of int 21h. The function number is: Exit the program.
int 21h ;Exit the program.
code ends ;End of the segment definition block.
end start ;Specifies that the program is executed from strat.
I'm so tired. I don't know if you're satisfied.
-
Spend money to buy a complete design, after four years of chic, it's time to spend some money to graduate.
-
1. Compiler.
A program that translates a program written in assembly language into its equivalent machine language program. The assembler inputs the source program written in assembly language and outputs the target program in machine language. Assembly language is a machine-oriented language designed for a particular computer or family of computers, consisting of assembly execution instructions and assembly pseudo-instructions.
Although writing a program in assembly language is not as simple and intuitive as a high-level programming language, the compiled target program occupies less memory, runs more efficiently, and can directly reference various device resources of the computer. It is often used to program the core part of the system, or to write program segments that require a lot of running time and real-time requirements.
2. Explain the procedure.
An interpreter is a language processing program that works in much the same way as a compiler in terms of lexical, syntax, and semantic analysis, but when running a user program, it directly executes the source program or the internal form of the source program (intermediate**). Therefore, the interpreter does not produce an object program, which is the main difference between it and a compiler.
3. Compile the program.
A compiler, also known as a compiler, is a translation program that translates a source program written in a high-level programming language into an equivalent machine language format target program. A compiler is a translation program that is implemented using a generative implementation approach.
It takes a source program written in a high-level programming language as input, and a target program represented in assembly language or machine language as output. The compiled target program usually goes through a running phase in order to run with the support of the runner, process the initial data, and calculate the required calculation results.
-
What does assembler mean? What does "assembler" mean? "Assembler" means:
A language translation program. Ability to translate source programs written in assembly language into target programs. It can check the source program for syntax errors and print out the wrong statement lines and error messages.
The resulting target program corresponds to the statement of the source program one-to-one. Compiler Explanation in the Chinese Cihai.
What does "assembler" mean?
A language translation program. Ability to translate source programs written in assembly language into target programs. It can check the source program for syntax errors and print out the wrong statement lines and error messages. The resulting target program corresponds to the statement of the source program one-to-one.
Compiler Explanation in "Chinese Cihai" Use the compiler to form sentences.
1.assemble the program by line; Progressive assembler 2The assembler accepts the mnemonic source program and generates the machine target module; 3.
In assembler design, one or more operations are represented by a combination of terms and parentheses. 4.A nomination (word) term used in assembly program design.
5.An expression that the assembler evaluates at the time of preassembly. 6.
In assembler design, indicate the number of digits occupied by the decimal part of a fixed-point or floating-point number in the target. >
-
Note: Immediate numbers must start with a number, if the first hexadecimal number is a letter, you can add 0 in front of it.
Once a variable is defined, it has the following three properties:
Indicates the logical segment in which the variable is stored, and the segment base value of the variable can be obtained using the SEG operator.
Indicates the number of bytes between the position of the variable and the start of the segment, and the offset of the variable can be obtained using the offset operator.
The type properties of a variable can be obtained using the type operator.
Example: Only storage space is allocated, and the initial value is arbitrary.
Example: Example:
The dw and dd pseudo-directives cannot be initialized with a string of more than two characters (even if dd has a space of 4 bytes), otherwise an error will occur.
DUP becomes a duplicate data operator and is used to allocate storage space in bulk.
Note:Shift operatorwithShift instructionsDifferent.
The shift operator's operands areSpecific numbers, the shift operation is inAt the time of compilationFinish.
The object of the shift command isRegisters or memory cells, the shift operation is inWhen the program is runningExecute.
Note: The logical operators are bothBitwiseOperation.
Note: Both expressions for the relative operator comparison are mandatoryThe same is a constantOr forin the same logical segmentvariables.
Constant comparison, pressUnsigned numberto compare.
Variable comparison, compare the twoThe size of the offset
The result of the relational operation is true(All 1).Or false(0 out of all).
Takes the base value of the segment where the variable or designator is located.
Takes the offset within the segment where the variable or designator is located.
If you take the type attribute of the variable or designator, the returned result is a number.
takevariablesLength.
If the variable is described by the duplicate data operator dup, the length operation takes the value given by the outer dup.
If no dup is used, the length operation returns a value of 1.
Example: The size operator can only be applied to a variable and returns the product of the variable type and length.
Modify or specify the type properties of variables, designators, or memory operands.
Modify the type attribute of the variable, designator, or memory address specified by the address expression to the specified type value.
Note: This type of modification is temporary, and the scope is this statement.
Separates the value of the expression from the high and low bytes.
The entered characters (ASCII code) are saved in the AL register.
Outputs characters in the DL registers.
loops execution process:
First of all, ajmp start is an unconditional jump, which is a direct jump to start, and the interrupt entry and pseudo instructions in the middle are not executed when the main program is run normally for the first time, but they are all assembled into instructions** exist in the rom, but they are skipped when executed, but they still exist when they are assembled. >>>More
It should meet your requirements.
But there was no way to go to the computer room for experiments. >>>More
INT 21 is a DOS function call, and the call function number is placed in AH, and the format is as follows: >>>More
C language is the foundation, what FPA
I think it's okay, now the system is mostly written in C, but it may be written in C at the beginning, and then the system is bigger, it is difficult to change it to C++, because the system is relatively large, so I think it is good to write in C++, easy to control, of course, the speed is to be discounted, but stability and flexibility should be more important, after all, the slow is better than the unmodifiable and the old crash, and the speed of C++ is not much worse than C, and even faster in some places, because now C++ development is much faster than CAs Bjarne Stroustrup said, learning C is just about dealing with the ** that is being taken as a legacy, hehe. I wonder if that's a bit too much? >>>More