小白求助 关于汇编指令 stos的问题
问题描述:
mov al,0xff
mov edi,0x12ffdc
stos byte ptr es://将al 寄存器中的数据拷贝到edi(12ffdc)后 edi的值 会增加或者减少
然后再次执行
mov ax,0xAAAA
stos word ptr es: //为啥还是往12ffdc中拷贝数据 前面的edi的值不是变化了吗?
图和上面数据不一样 大家伙将就着看吧 顶 https://www.tutorialspoint.com/assembly_programming/assembly_stos_instruction.htm
The STOS instruction copies the data item from AL (for bytes - STOSB), AX (for words - STOSW) or EAX (for doublewords - STOSD) to the destination string, pointed to by ES:DI in memory.
The following example demonstrates use of the LODS and STOS instruction to convert an upper case string to its lower case value −
section .text
global _start ;must be declared for using gcc
_start: ;tell linker entry point
mov ecx, len
mov esi, s1
mov edi, s2
loop_here:
lodsb
or al, 20h
stosb
loop loop_here
cld
rep movsb
mov edx,20 ;message length
mov ecx,s2 ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
s1 db 'HELLO, WORLD', 0 ;source
len equ $-s1
section .bss
s2 resb 20 ;destination
页:
[1]