-2

我用汇编语言写了我的名字,我想把它打印出来。我不知道如何向后写。

这是我需要向后打印的代码。

TITLE this is a a-to-z program      (backchar.asm)
; Penpa Gyaltsen

INCLUDE Irvine32.inc
.data
space byte ' ',0
myname byte "Penpa Gyaltsen",0
copyofname byte lengthof myname dup(?)

.code
main PROC
        mov eax,0
    mov ecx,lengthof myname
    mov esi,0

backloop:

    mov al,myname[esi]
    mov copyofname[esi],al
    call writechar
    mov edx,offset space
    call writestring
    inc esi
loop backloop;

    call crlf
    exit
main ENDP
END main
4

1 回答 1

0
TITLE this is a a-to-z program      (backchar.asm)
; Penpa Gyaltsen

INCLUDE Irvine32.inc
.data
space byte ' ',0
myname byte "Penpa Gyaltsen",0

.code
main PROC
        mov eax,0
        mov ecx,lengthof myname
        mov esi,lengthof myname
        mov edi,0

backloop:

    mov al,myname[esi]
    call writechar
    mov edx,offset space
    call writestring
    dec esi
loop backloop;

    call crlf
    exit
main ENDP
END main

我得到了答案,但它错过了字符“P”

打印出来像:nestlayg apne

于 2013-10-22T23:18:55.243 回答