Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly 组件中的在位反向管柱_Assembly_X86 - Fatal编程技术网

Assembly 组件中的在位反向管柱

Assembly 组件中的在位反向管柱,assembly,x86,Assembly,X86,我对这个代码有一些问题。我在终端弹出窗口中看不到结果。我需要在同一内存中反转字符串。请帮我输入这个代码 text db 'some dec/hex/bin here' change db 26 dup('?') Begin: lea si, text lea di, change mov cx, 26 changes: mov al, [si]+26 mov [di], al dec si inc di

我对这个代码有一些问题。我在终端弹出窗口中看不到结果。我需要在同一内存中反转字符串。请帮我输入这个代码

 text db 'some dec/hex/bin here'
 change db 26 dup('?')

 Begin:
    lea si, text
    lea di, change 
    mov cx, 26
 changes:
    mov al, [si]+26
    mov [di], al
    dec si  
    inc di            
 loop changes 
    lea si, text
    lea di, change 
    mov cx, 26
 back:
    mov al, [di]
    mov [si], al
    inc di
    inc si 
    loop back
 Print:
    mov ah, 09h
    lea dx, text 
    int 10h
 Ending:
    mov ax, 4c00h
    int 21h
 End Begin

由于文本只有21个字符
mov al,[si]+26
读得远远超过了它
您错误地使用
int 10h
进行打印!应为
int21h

您还需要一个$来正确终止字符串

我不会称之为就地反转,因为您使用的是单独的缓冲区。考虑使用2个指针,每个指针在一个端点处初始化,并向文本中间移动。