0

there is an error in line 20 that can't mov edx,dx and other error in line 30 " the function name "

can someone help me ? note :: .startup in my code mean mov ax,@data mov ds,ax

.model small,c
.486
.stack 200h
.data 
    num DW ?


    arr db "Plese enter a Number$"
.code
    rev proc _TT:word
    uses ebx,eax,cx
    LOCALS
    mov EBX,0
    mov cx ,0
    mov Ax,_TT
again: CWD
    div cx
    imul  EBX,10
    movs edx,dx  ; <=== error here
    push EAX
    mov ax,dx
    cwde
    add ebx,eax
    pop eax
    cmp eax,0
    JG again
    ret
    endp
    rav
.startup

    .exit
    end
4

1 回答 1

1

这些是与您的原始问题相关的违规行,以及它们的正确替换:

movs edx,dx  ; <=== error here

用。。。来代替:

movsx edx,dx  ; Sign-extend dx into edx


endp
rav

用。。。来代替:

rev endp ; the end of "rev proc"

于 2013-03-25T20:27:28.703 回答