2 att assembly language knowledge
In Linux source code, files with the. s extension are "pure" assembly language files. Here, we combine
The specific example introduces some att assembly language knowledge.
1. GNU
Calm down to a special review of the RTOs, take Mqx-lite to start, re-read the code, record drip, for summary. 1. Pre-compilation
(1) commonly used precompiled directives such as # define and # include are also available in assembly files.
Precompiled directives are implemented by the precompiled compiler, #define执行是在编译器的符号表中建立新的符号 (and assigned values, corresponding to the precompiled instruction Equ of assembly
Assembly Language (assembly language) is a low-level language for computers, microprocessors, microcontrollers, or other programmable devices, also known as symbolic languages. In assembly lan
Town Field Poem:——— Dream who feel, the water month Build blog. Baiqian tribulation, only know the vicissitudes of the world.——— today holds the Buddhist language, the technology is boundless willing to learn. Willing to do what you learn, cast a conscience blog.——————————————————————————————————————————Some students ask me, 8086 assembly language with what to wr
point where return is required) can result in the correct results.In fact, we can use an inline assembly code to verify that our guesses are correct. We change the value of the EAX after the recursive call, using the inline assembly plus a code for assembly.
——————————-figure Seven using the inline assembly to in
)The secondary flag bit mainly represents the lower 4 carry or borrow, and CF is different, CF is eight bits produce carry and borrow to set the flag bitSo this is the auxiliary carry flag bitLike what:3AH + 7CH = b6h, low four bit with carry, then AF = 1DF direction flag bit (Direction flag)For example, if our Si and Di address registers are to be memcpy, the memory will increase or decrease.DF is the direction of the change in the control address.DF = 0, the memory address is automatically inc
. 25G, Memory registers (3) today, according to a compilation program,,, (4) learning to assemble the loop (5) Learning assembly-Data processing (6) Learning assembly-transfer Instruction (7) learning the assembly of Call and RET (8) Learning assembly-Flag registers (9) Learning as
After analyzing the function call stack of C language and knowing the function call mechanism of C, let's take a look at how the code of the starting part of linux0.11 jumps into the C language function from the assembly. The following code is seen in the Head.s file in Linux 0.11 (the Start Analysis section of linux0.11 is re-analyzed in the other part, as this
1. Development Tools
In assembly languages, the tools used mainly use the following:
Assembler, connector, debugger, Compiler
Because I am here using ATT assembly language, the tools are also under gnu.
1.1 assembler ()
There are many assembler tools, such as masm, nasm, and gas. Unlike advanced languages, although they are all called
Just talk about one question:
_ Switch_data in head_common.s:
. Long init_thread_union + thread_start_sp
Init_thread_union cannot be redirected using ctags, and there is no init_thread_union in the Link script. Using grep search, we found that this is the name of the federated variable in arch/Unicore/kernel/init_task.c3 (no jump, there is no link to the script, that is, the Assembly file of the file is not like the C file, the header file needs to be
This article mainly introduces the C language in the array and pointer assembly code analysis examples, this article uses a C language example to get the corresponding assembly code, and one by one to annotate the meaning of each sentence assembly code, need friends can refe
technology, everyone has their own set of methods. If there is no right or wrong, I still share my consistent point of view: I only want to read novels that are useful to me and useless.
First, why is the title of this article "An assembly language" emphasized ". I think everyone knows that the Assembly Language is ju
DOSBox editing interface; the spelling of the following command ignores the case.1) Run DOSBox, enter the command under command c:\>: Edit filename. asm, start EDIT.EXE Enter code edit state, enter program code:2) After saving the file, return to the command line of DOSBox, enter the command: MASM file name. ASM, generate the target file file name. OBJ (You can modify the target filename during the build process, and the direct carriage will keep the default target file name).3) Enter the comma
For college students, basic need to learn advanced programming language, I believe most of the science and technology students know C + +, C, Java language and other high-level language, but also know the machine language of the most low-level language, but there are many do
1.1 Machine Languagesince to speak assembly language can not be mentioned machine languages, machine code is composed of 0 and 1 instruction sequence, the computer can directly execute machine code, so in machine language programming program execution speed, since this, So why do programmers now basically use machine language
Since the development of assembly language, the following three types of directives are composed.1. Assembly instruction: the mnemonic of the machine code, has the corresponding machine code.2. Pseudo-directive: there is no corresponding machine code, executed by the compiler, the computer does not execute.3. Other symbols: such as: + 、-、 *,/etc., recognized by t
Assembly language is the most closely related to hardware in various computer languages, the most direct language, is the most efficient language of time and space, it can use all the hardware characteristics of computer and can directly control the hardware, so in the computer application system design and process con
This blog series reference from In the previous chapters we learned some instructions intermittently, but never complete an executable file, an. exe file, in assembly language. From this chapter we will begin to use assembly language and compile the compiler to link a complete executable file.4.1 The process of a sourc
"Assembly language" as a language, corresponding to the compiler of high-level language, we need an "assembler" to assemble the original file of assembly language into machine executable code. Advanced compilers such as MASM, TASM
I. Machine language
Definition: a collection of machine instructions. (The machine instruction is a string of binary digits.) )
working process : The computer makes the machine instruction into high and low frequency, drives the electronic device, carries on the computation.
Two. Assembly language
composition : (1).
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.