1, What is assembly language , Its position in computer language ?
Assembly language is the basic language of programming language , It's the only language that can deal directly with computer hardware
2, Assembly language source , assembler , The relationship of compilation ?

3, Characteristics of assembly language
1) One to one correspondence between assembly language and machine instruction , Fully understand the operation process of the computer Assembly language instructions are symbolic representations of machine instructions 2) Assembly language is a language close to machine
Programming requires familiarity with the machine hardware system , Make full use of all the functions in the machine hardware , Give full play to the characteristics of the machine
In computer system , Some functions are realized by assembly language program : Real time process control system , System initialization , Actual I / O device operation 3) Assembly language programs are more efficient than high-level languages
efficiency , It refers to the high efficiency of the target program after the assembly of the source program written in assembly language Time domain efficiency : Fast operation ; High efficiency in space domain : Less storage space occupied by object code
4, The comparison between assembly language and advanced language

5, Base conversion
( slightly )
6, Data organization unit
1) position (bit) Is the smallest unit of information in a computer , Symbol b, Is a binary bit , For everyone 0 or 1 express 2) byte (Byte) 8 Bit binary number is one byte 3)
word (Word) Several bytes are one word , Generally, a word contains two bytes Range 0000H~FFFFH 4) Doubleword (Double Word)
Two bytes are one word , Four bytes are consecutive words , It's called doubleword Range 00000000H~FFFFFFFFH 5) Word length
The length of machine word is word length , That is, the number of digits contained in each word in the computer , Determined by the number of machine data buses for example , The number of data buses is 64 position , Machine word length is 64 position , That is, every word has 8 Bytes 6) Data word and instruction word
Data word : Data is stored in the storage unit Instruction word : Instructions are stored in the storage unit Whether it's a data word or an instruction word , They are stored in binary form in the storage unit
7,BCD code
Two storage methods : Combined type (1 Byte representation 2 individual BCD code ); Uncombined type (1 Byte representation 1 individual BCD code )
8,80X86 Computer organization structure
The hardware system of microcomputer is mainly composed of 3 Main components : 1) a central processor CPU( Arithmetic unit , controller , register ) 2) I / O equipment 3) storage
9,80X86 CPU Register of
Registers are divided into 3 class : 1) General register 2) Control register 3) Segment register 8 individual 8 Bit general register :AL,AH,BL,BH,CL,CH,DL,DH
8 individual 16 Bit general register :AX,BX,CX,DX,SI,DI,BP,SP 8 individual 32 Bit general register :EAX,EBX,ECX,EDX,ESI,EDI,EBP,ESP

explain :1) Pointer register (SP,ESP,BP,EBP) SP,ESP Is a stack pointer register , Store the offset address of the top of the current stack segment , It moves automatically according to instructions , To read randomly
Data in stack segment , Must pass BP or EBP Base pointer register to read . 2) Control register (IP,EIP,FLAGS,EFLAGS)
IP,EIP Is the instruction pointer register , For storing currently executing instructions Offset address of next instruction , This register refers to the offset address of the code segment .
FLAGS Is the identification register , Represents the state and some special controls of the program at runtime

3) Segment register Code and data are stored separately , Code stored in code snippet , Data stored in data segment
10, Memory organization
1) Address of memory The basic unit of memory unit in memory is * byte *, Each byte has a unique address

2) Contents of the storage unit The information stored in a storage unit is the content of the storage unit Divided into : Byte unit , Word unit , Doubleword unit Doubleword : Two are needed 16 Bit register , Usually DX:AX,DX high position ,AX Low order

3) stack A stack is a specific area of memory , Where the data is in accordance with * First in first out * principle effect : Staging data , Subroutine call and return , Call interrupt handler , Return from interrupt handler
position : Stack segment address stored in SS Register , The offset address is stored in the stack pointer register (SP(16 position )/ESP(32 position )), They always point to the top of the stack
initialization : Initialization of the stack by setting SS and SP/ESP Value to complete , Can be done automatically by the compiling system , You can also use the Defined by pseudo instruction in
11, Real mode
1) introduce only 8086/8088 Working in real mode ; 80286 The above microprocessors work in real mode and protection mode ; Microprocessors can only address in real mode 1MB Storage space of ;
80286 The microprocessors of the above systems start to work in real mode when adding points or resetting 2) Segmentation of memory address * Why segments ?*
8086/8088 Address bus is 20 root , The accessible address is :2^20=1048576=1M
8086/8088 Internal registers are 16 Bitwise , Can be handled directly 16 Bit length storage address ,16 Address of bit address 2^16=64K
To extend the addressing range to 1MB, Real mode memory addresses are addressed by using the segmentation technology of memory space 1MB Storage space of The combination of segment address and offset address is proposed 20 The concept of bit physical address * Segmentation method ?*
16 Bit segment address +16 In segment address --->20 Bit physical address Combination of addresses : Physical address = Segment address *16D( or 10H)+ Offset address ,( Segment address *16D-- Binary segment address shift left 4 position )
Storage section address :16 Bit segment address register (CS,DS,SS,ES) Storage offset address :16 Bit pointer register (IP,SP)
stay 1MB Memory can have 64K Segments , Maximum per segment 64KB, Minimum is 16KB * Physical address , Segment address , In segment address , The difference of logical address ?*
Physical address : One to one correspondence with memory unit 20 Bit binary number ,1MB=00000H~FFFFFH Each physical address represents a unique memory unit
Segment address : take 1MB The memory space of is divided into long 64KB The program and data areas of are called segments For each segment 1 individual 16 Bit binary address representation Segment address is stored in segment register
Code snippet : Binary code for storing source program , The segment address of the segment is placed in the CS in Data segment : Storage of operation data , The segment address of the segment is placed in the DS in stack segment : Storage area for stack , The segment address of the segment is placed in the SS in
Additional segment : The segment address of the segment is placed in the ES in In segment address :16 Bit binary segment address is offset address
( Offset address ) The offset addresses in different segments are stored in different registers , Segment register and register with offset address are combined according to certain requirements

Logical address : Using segment address and offset address to represent the address of memory unit as logical address , for example , Segment address : Offset address * Conversion relationship between logical address and physical address ?* Physical address =
Segment address *16D(10H)+ Offset address Logical address = Segment address : Offset address example : Logical address ,1111H:2222H Physical address ,1111H*10H+2222H =
13332H hypothesis 1111H Is the code segment address ,2222H In the pointer register IP in , The schematic diagram is as follows :

* Memory allocation method ?* Code snippet , Data segment , Stack segment size , It allocates the memory area in the smallest unit of section 16 byte =2 A word =1 section , The boundary address of a section can be 16 Divisible address
Offset address ( In segment address ) From 0000H Starting example : Suppose that the program allocates memory from the 6100H start , Program length 1020 byte , Operands 510 byte , stack segment 250 byte
The code segment length is 1024D=400H, Segment length is 512D=200H, Stack segment length is 256D=100H The schematic diagram is as follows :

* Relationship between segments ?* 8088/8086 CPU hold 1MB The storage space of is divided into several logical segments The starting address of each segment must be able to be 16 Divisible number The maximum length of a logical segment is 64KB
1MB Of storage space can be divided into 64K Logical segments , When each logical segment is 16KB Time Segments can be adjacent to each other , separate , overlap , Partial overlap
12, Protection mode
1) Protection mode memory addressing mechanism In protected mode , Logical address = Selector + Offset address Different from real mode , Real mode segment register storage segment base address , In the protection mode, the segment register store selector
In protection mode , By selecting descriptors in the descriptor table , Indirectly form segment base address The maximum offset address of the protection mode can be 32 position , The maximum segment length can be from 16KB Extend to 4GB 2) descriptor
Descriptors include , Segment position in register , Length of segment , Access rights By base address , Segment boundary , Access rights , Additional field composition Base address : Specify the starting address of the segment Segment boundary : Store the maximum offset address of the segment
Access rights : Describe the function and some control information of this section in the system Additional fields : Describe some properties of the segment The content of the descriptor is set automatically by the system Because segment register is 16 Bitwise , Descriptor is 64 Bitwise
Therefore, the 64 The segment descriptors of bits are placed in order to form a segment descriptors table , In memory In the segment register, the sequence number of the segment descriptor table to be selected is actually stored , Similar to subscript in array
13, Memory management mechanism
1) Segment management mechanism ① Virtual storage : Get more space on limited physical storage * How does virtual storage realize storage ?*
At any time during program execution , Virtual memory system automatic bar program is divided into many small blocks, namely program sections Store a program segment in physical memory , Other segments on disk
When the program wants to access which program segment , Which program segment to boot into physical memory ② Segment management : take 4GB The storage space of is divided into several independent protected storage space blocks
Each application can use these blocks of storage space 2) Paging management mechanism ① Linear address space : Each process has the same size 4GB linear space
Mapping from virtual address space to linear address space with segment management mechanism , Realize two-dimensional Virtual address converted to one-dimensional linear address
② Paging storage management : The linear address space and physical address space are divided into blocks of the same size , Each piece is 4KB Such a block is called a page , The implementation of linear address space to physical address space through paging management mechanism
mapping , Realize the transformation from linear address to physical address

©2019-2020 Toolsou All rights reserved,
TypeScript Data types in is enough exercises 11-5 Output string at specified position STM32 Infrared tracking car ( Essence 2020 year 6 month 2 Daily update ) TypeScript Function explanation Keras Summary of training data loading about Navicat for mysql Of 2003 error Paging tool class PageResult【Python】 read txt file , Gets the specified location data in the specified row pytorch of ResNet18( Yes cifar10 The accuracy of data classification is achieved 94%)SSM Project's excel File upload and add to database