Basic structure of PC system
Cpu
Memory
Directives and data
Storage unit
Address bus
Control bus
Data bus
CPU
A typical CPU is composed of an operator, a controller, a register, and other devices.
8086 General Purpose Registers: AX, BX, CX, DX, SI, DI, SP, BP, IP, CS, SS, DS, ES, PSW.
x8086 is a 16-bit structure of the CPU:
The operator can process up to 16 bits of data at a time.
Register maximum width is 16 bits
The
For more information, seeArticle: Linux Assembly Language Development Guide
1. Assembler
Assembler is used to compile the source data in an assembly language.ProgramConvert to a binary targetCode. The standard Assembler for Linux isGas, which is the background Assembly Tool on which GCC depends, is usually incl
Intel assembly is usually used in windows, while att assembly is used in Linux. The two are obviously different in syntax.
If
ProgramMust be embedded in assembly, and cross-platform is required? The general idea is to compile a set of operating systems, such as Windows and Linux.
Code. In this way, the maintainability is worse. After all, there are two sets of
of the program
Enter d ss:0 to display the data at the stack segment + offset 0 and back
Enter G 001a so that the first loop is executed and then enter D ss:0 to display the data in the stack
Looking at the first line, the data in the data segment has been pressed into the stack, then the result after the second loop has been executed.
Enter G 0027, then D ds:0, then D ss:0
See, the data in the data segment has been reversed.
Input T, single step to 21H interrupt
Enter P, run interrupt, and
The time has come so fast.This article is called "Assembly Language II, three or four, five or six, seven or eight" I probably want to lazy, and will be lazy. Learning assembly language, like learning other languages, should be more practice, and then get a hand-called development environment, previously found that Win
This article systematically introduces how to use the assembly language on iOS devices using xcode.
1. Create an assembly source file:
Right-click the directory where the source file is stored in your xcode project and select new file. Then select other in the IOS column on the left. On the right side, you will see the Assemb
: Network Disk DownloadThe assembly Language (2nd edition) is a collection of mnemonics for machine instructions provided by various CPUs, and one can directly control the hardware system with assembly language. Assembly language
Source
Very simple C language code, the function is to exchange two number:1 #include 23void swap (intint * b) { 4 *a = *a + *b-(*b = *a); 5 return ; 6 }Assembly Code Parsing
executed in the GCC compilation environment, the Gcc-s-o test.s test.c command generates the relevant assembly code.1. file"test.c"2 . Text3 . Globl _swap4. def _swap;.
Assembly Analysis of advanced language programs
In advanced languages, such as C and Pascal, we do not directly operate on hardware resources, but solve problems. This is mainly reflected in data abstraction and program structuring. For example, we use a variable name to access data, instead of worrying about where the data is stored in the memory. In this way, the use of hardware resources is completely ha
the two-font (32-bit) data in memory address 12345678 to EAX----------------------------------------------------The difference between MOV and LeaIt can be said that MOV this assembly instructions in the assembly language program is very very common in an instruction. Make the simplest analogy, like IPeople want to talk every day like that. In
ASCII code3.E command--Modify memory unitFormat: E start position modified value modified value .... If the offset address is followed directly by E, modify the cell value of the offset address under the current data segment, and you can modify the contents of the other segment's CDs with the e command.E 10 Modify Current data segment 10H unit contentE es:100 Modify Fu 100H unit content4.U command--disassemblyA binary machine instruction code generated after
This article provides an overview of the basic data types in the 8086 assembly, such as Integer, character, string, array, struct definition and reference methods.One, IntegerIn the assembly, integers can be divided into bytes (db), Word (DW), Gemini (DD) and other typesInteger definition Format: (variable name) (data type) (data)Data segmentyear - 5 day8data ends After defining the integer variable
breakpoint is specified, stop execution when the instruction arrives at the instruction address and display the contents of each register flag bit and the next command to execute, allowing the user to set a maximum of 10 breakpoints. Example: A:\>debug tan.exe-u: Anti-compilation into assembly language process code ..... -G 100 Specifies the breakpoint program terminated normally: In addition: We can run a
Assembly language instruction is the symbolic of the machine instruction, and the machine directive has the direct correspondence relation, therefore the assembly language also has the difficulty to study difficult to use, error prone, the maintenance difficulty and so on shortcoming.But the
Assembly Language Basics (register)First of all, the structure of a CPU generally contains the operators, controllers, registers, caches, buses, etc. their functions are briefly:1. Information processing by the arithmetic device2. Register for information Processing3. Controller control of the device to work4. Internal bus connection of various devicesDifferent CPUs, the number of registers, the structure i
: parameters do not occupy registers or storage units. The parameters are stored in the public stack. After processing, the customer recovers. The number of parameters is generally unlimited.
Disadvantage: Because parameters and subprograms are mixed together, you must calculate its position in the stack carefully when accessing parameters. Pay attention to the resumable storage and restoration.
4. Address Table Method
In this way, a parameter table composed of parameters is placed in a certa
(i) Research overviewWhy do we have to use variables? Because we must store the data when we are programming. So if you can store data in a different way, we don't have to use variables for this purpose.What is the way to store data? In Learning assembly language is. We store the data in registers and in memory space. So, in this experiment, we're studying how to use registers in the C
assembly language (Basic knowledge) 011, assembly language is the main body is the assembly instructions. The difference between the assembly instruction and the machine instruction is in the representation method of the instructi
I. Compilation overview1. The reason for using the assembly (1) Start the code: in the bootloader and the initialization of the kernel to use the assembly, because there is no resume C language operating environment.(2) code that has special requirements for efficiency: The assembly code is highly efficient.2. Classifi
Tag: Operation while running compilation relative angle in memory div strongObjectiveSpeaking of reading a compilation, someone will always ask: what is the meaning of reading a compendium? Does reading the assembly help me with my development work? ... I think reading the assembly is to let us better have the knowledge of the principle of computer work, not just blindly strategically advantageous position.
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