小白求助 关于 movs和stos 的增减方向问题
问题:movs 指令在D标志位为0的时候edi和esi都是加地址数吗?在D标志位为1的时候 使用movs edi和 esi都是加地址数?
stos指令 在D标志寄存器为0的时候 edi是加地址数?D标志位为1的时候 减地址数? MOVS - Move String (Byte or Word)
Usage:MOVS dest,src
MOVSB
MOVSW
MOVSD(386+)
Modifies flags: None
Copies data from addressed by DS:SI (even if operands are given) to
the location ES:DI destination and updates SI and DI based on the
size of the operand or instruction used.SI and DI are incremented
when the Direction Flag is cleared and decremented when the Direction
Flag is Set.Use with REP prefixes.
Clocks Size
Operands 808x286386486 Bytes
dest,src 18 5 7 7 1 (W88=26)
STOS - Store String(Byte, Word or Doubleword)
Usage:STOS dest
STOSB
STOSW
STOSD
Modifies flags: None
Stores value in accumulator to location at ES:(E)DI (even if operand
is given).(E)DI is incremented/decremented based on the size of
the operand (or instruction format) and the state of the Direction
Flag. Use with REP prefixes.
Clocks Size
Operands 808x286 386 486 Bytes
dest 11 3 4 5 1(W88=15)
上善若水··· 发表于 2020-5-6 22:21
MOVS - Move String (Byte or Word)
Usage:MOVS dest,src
MOVSB
看不懂啊 大佬 本帖最后由 xie1234abc 于 2020-5-15 13:53 编辑
mov ax,data1
mov ds,ax
mov si,0
mov ax,data2
mov es,ax
mov di,0
cld ;将DF置0,正序传送。
movs byte ptr es:,ds: ;传第0个,后将si/di加1
movs byte ptr es:,ds: ;这时si/di为1,所为是传第1个,后将si/di加1
mov si,15
mov di,15
std ;将DF置1,逆序传送。
movs byte ptr es:,ds: ;传第15个,后将si/di减1
movs byte ptr es:,ds: ;这时si/di为14,所为是传第14个,后将si/di减1
手打的,很累,望采纳!
页:
[1]