当前位置:网站首页>Chapter 8 - two basic problems of data processing

Chapter 8 - two basic problems of data processing

2022-06-12 08:54:00 Pickup Ping

introduction

  • reg( register ) aggregate :ax、bx、cx、dx、ah、al、bh、bl、ch、cl、dh、dl、sp、bp、si、di;
  • sreg( Segment register ) aggregate :ds、ss、cs、es( Extension )

8.1 bx、si、di、bp

  • Can be used as [bp]
  • The four combinations can only appear as follows :bx and si、bx and di、bp and si、bp and di
  • If not given directly bp Section address of 、 The segment address defaults to ss

8.2 Location of data processed by machine instructions

  • Before the command is executed , The data to be processed can be in three places :CPU Inside 、 Memory 、 port
     Insert picture description here

  • idata ( Count now )

  • register

  • Segment address SA And offset address EA

8.3 The expression of data position in assembly language

  • A register that explicitly gives the address of a storage segment
  • The register storing the segment address is the default

8.4 Addressing mode

 Insert picture description here

8.5 How long is the data to be processed by the instruction ?

byte---- 8 position
word—16 position
High address points to high byte

The size of the data to be processed is indicated by the register name

The operator X ptr Indicates the length of the memory unit

mov word ptr ds:[0],1 # therefore ds:[0] Deposit is 0001H
mov byte ptr ds:[0],1 # therefore ds:[0] Deposit is 01H

Other methods

  • push[1000H] There is no need to specify what data is being accessed , because push Instructions only perform word operations .

8.6 Comprehensive application of addressing mode

8.7div Instructions

  • Division instructions , Divisor in memory unit or register , The divisor is in AX or DX and AX in
Divisor Divisor
8 position 16 position (AX)
16 position 32 position (DX+AX)

If the divisor is 8 position , Shang Zai AL, The remainder is in AH
If the divisor is 16 position , Shang Zai AX, The remainder is in DX

Command format

div reg
div  Memory unit 
div byte ptr ds:[0]#(al)=(ax)/((ds)*16+0) The business of ,(ah)=(ax)/((ds)*16+0) The remainder of 
div word ptr es:[0]#(ax)=[(dx)*100000H+(ax)]/((ds)*16+0) The business of ,(dx)=[(dx)*100000H+(ax)]/((ds)*16+0) The business of ,

8.8 Pseudo instruction dd

data segment
	 db 1
	 dw 1
	 dd 1
	 data ends

stay data Three data are defined in the section :
The first data is 01H, stay data:0 It's about , Occupy 1 Bytes ;
The second data is 0001H, stay data:1 It's about , Occupy 1 A word ;
The third data is 00000001H,data:3 It's about , Occupy 2 Bytes ;

8.9dup

db Number of repetitions dup( Duplicate byte data )

db 3 dup(0)# Defined 3 Bytes , Their values are all 0, amount to db,0,0,0
db 3 dup(0,1,2)# Defined 9 Bytes , They are 0、1、2、0、1、2、0、1、2
db 3 dup('abc','ABC')# Definition 18 Bytes , They are 'abcABCabcABCabcABC'
原网站

版权声明
本文为[Pickup Ping]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206120842165720.html