当前位置:网站首页>Chapter 3 registers (memory access)
Chapter 3 registers (memory access)
2022-06-12 08:54:00 【Pickup Ping】
Here's the catalog title
3.1 Storage of words in memory
stay 0 Start storing... At the address 20000(4E20H):
- Be careful :0 Unit number is the low address unit ,1 Unit number is a high address unit .
3.2 DS and [address]
- 8086CPU There is one of them. DS register , The segment address usually used to store the data to be accessed .
- Read 10000H The content of the unit
mov bx,1000H
mov ds,bx
mov al,[0]
mov al,[0]
Known mov Three transfer functions that can be completed by instructions :
- Put the data directly into the register ;
- Send the contents of one register into another .
- besides ,mov Instructions can also put the contents of a memory unit into a register .
mov Command format :
mov Register name , Memory unit address
“[…]” Represents a memory unit ,“[…]” Medium 0 Represents the offset address of the memory unit .
- When the command is executed ,8086CPU Pick up automatically DS The data in is the segment address of the memory unit .
8086CPU It is not supported to directly send data into the segment register .
- How to send data from register to memory unit ?
- take al The data in is sent to the memory unit 10000H?
- Conclusion :
MOV BX,1000H
MOV DS,BX
MOV [0],AL
3.3 The transmission of words
- 8086CPU One word at a time
MOV BX,1000H
MOV DS,BX
MOV AX,[0]
MOV [0],CX ;cx Medium 16 Bit data is sent to 1000:0 It's about
3.4 mov、add、sub Instructions

3.5 Data segment
- We can make a group of length N(N≤64K)、 Address continuous 、 The starting address is 16 A memory unit that is multiples of a memory unit is used as a memory space dedicated to storing data , This defines a data segment .
- For example, we use 123B0H~123B9H This space is used to store data :
- Segment address :123BH
- length :10 byte
3.1~3.5 Section
- When a word is stored in memory , To use two consecutive address memory units to store , The low order byte of a word is stored in a low address unit , The high byte is stored in the high address unit .
- use mov Instruction to access memory cells , Can be in mov Only the address given in the instruction unit is offset , here , The segment address defaults to DS In the register .
- [address] Represents an offset address of address The memory unit of .
- When transferring font data between memory and register , High address units and high 8 Bit register 、 Low address units and low 8 Bit registers correspond to .
- mov、add、sub Is an instruction with two operands .jmp Is an instruction that has an operation object .
3.6 Stack
- Last in, first out
- Basic operation : Push and pull
3.7 CPU Stack mechanism provided
Push :PUSH
Out of the stack :POP
- 8086CPU The stack in and out of stack operations are based on words .
- 8086CPU in , There are two registers :
- Segment register SS Store the segment address at the top of the stack
- register SP Store the offset address of the top of the stack
- Anytime ,SS:SP Point to the top element of the stack .
3.8 The problem of stack top out of bounds
- SS and SP Only the address at the top of the stack is recorded , Rely only on SS and SP It can ensure to find the top of the stack when entering and exiting the stack .
- Use when the stack is full PUSH Instruction stack , Use when the stack is empty POP Instructions are out of the stack , There will be stack top supersession problems .
- It's dangerous to overstep the top of the stack :because Since we arrange a space as a stack , Then the space outside the stack space is likely to store data for other purposes 、 Code etc. , These data 、 The code may be in our own program , It could be from another program .
Stack and memory
- Stack space, of course, is also part of memory space , It is just a space that can be accessed in a special way
3.9 push、pop Instructions
push register : Stack data in a register
pop register : Out of the stack , Use a register to receive data from the stack
push Segment register : Stack data in a segment register
pop Segment register : Out of the stack , Use a segment register to receive data from the stack
push Memory unit : Put the word at a memory unit on the stack ( Stack operations are all in words )
pop Memory unit : Out of the stack , Use a memory word unit to receive the stack data
Instruction execution ,CPU To specify the address of the memory unit , Can be in push、pop The instruction gives the offset address of the memory unit , The segment address is when the instruction is executed ,CPU from ds Get in .
3.10 Stack segment
- We can take the length of N(N<=64K) A set of addresses in succession 、 The starting address is 16 Multiple of memory units , Use as a stack , This defines a stack segment .
- Treat a piece of memory as a stack segment , It's just an arrangement when we're programming ,CPU Not because of this arrangement , Is executed push、pop When we wait for the stack operation instruction, we will automatically take the stack segment we defined as Make stack space to access .
边栏推荐
- Principle and configuration of MPLS
- (P13) use of final keyword
- Difference between binary GB and gib
- [data storage] storage of floating point data in memory
- When converting tensor to ndarray in tensorflow, the run or Eval function is constantly called in the loop, and the code runs more and more slowly!
- You have an error in your SQL syntax; use near ‘and title=‘xxx‘‘ at line 5
- 在Tensorflow中把Tensor转换为ndarray时,循环中不断调用run或者eval函数,代码运行越来越慢!
- 通俗理解时域采样与频域延拓
- [essence] explain in detail the memory management mechanism in QT
- torch. logical_ And() method
猜你喜欢
![[dynamic memory management] malloc & calloc and realloc and written test questions and flexible array](/img/d2/a6276d8415c46124920395df5651d1.png)
[dynamic memory management] malloc & calloc and realloc and written test questions and flexible array
![[character set 7] what are the wide character codes and multi byte codes of Chinese characters](/img/8c/6d375d90234e6094b6930c2cefefa1.png)
[character set 7] what are the wide character codes and multi byte codes of Chinese characters

域名映射到指定IP

Background fixing effect

Flink传入自定义的参数或配置文件

Centso8 installing mysql8.0 (Part 2)
![[data storage] storage of floating point data in memory](/img/c4/a67735858ce5d58bd504b087a2d123.png)
[data storage] storage of floating point data in memory

【进阶指针一】字符数组&数组指针&指针数组

ERROR 1630 (42000): FUNCTION a.avg does not exist. Check the ‘Function Name Parsing and Resolution‘

Analysis of 43 cases of MATLAB neural network: Chapter 7 regression of RBF Network -- Realization of nonlinear function regression
随机推荐
Gets the number of occurrences of a character in a string
Principle and configuration of MPLS
Knee joint
About weights exercise
Detailed explanation of private, public and interface attributes in cmake
第五章-[bx]和Loop指令
Jump to an interface at a specified time. (Web Development)
Judge whether the object is empty
正则校验用户名
Box model border
Problems that cannot be resolved by tar command
JS to refresh the page after loading
43 cas d'analyse du réseau neuronal MATLAB: chapitre 7 régression du réseau RBF - - réalisation de la régression fonctionnelle non linéaire
Binlog in mysql:
Display the remaining valid days according to the valid period
POI library update excel picture
Flink CheckPoint : Exceeded checkpoint tolerable failure threshold
动态创建表单并提交
2022.6.11-----leetcode.926
Introduction to Chang'an chain node certificate, role and authority management