• λ我爱Aspx >> C#.Net >> 求汇编实现三位十进制的加法
  • 求汇编实现三位十进制的加法

  • :aspxer  Դ:csdn  :2007-6-12 3:44:54  ؼ:
  • hexibin proc near

    mov ax, bx

    mov cx, 1h ;set 1 into cx as initial

    xor bx, bx ;set result into bx

    loop2:

    mov dl, 10d ;set 10d to bl

    div dl ;ax div bl

    mov dl, ah ;save the remainder in dl

    xor ah, ah ;set ah to 00h

    cbw ;change al(quotient) to type word

    mov temp, ax

    xor ax, ax

    mov al,dl ;save the remainder back to al

    cbw ;change it to word

    mul cx ;mul cx

    add bx, ax ;add it to old remainder

    mov ax, cx ; make cx mul by 10h

    mov dx, 10h

    mul dx

    mov cx, ax

    mov ax, temp

    cmp ax, 0d ;compare with zero

    je exit2 ; if equ zero then exit

    jne loop2 ;else save it back to the stack

    exit2:

    ret

    hexibin endp

    ;-----------------------------------------------------------------------

    binihex proc near

    Ҷƪл˵?
  • һƪ按纽点击时间
    һƪ有一个问题,帮忙解决一下,谢谢了