assembly language, displaying numbers in 10-binary fashion

Source: Internet
Author: User
printit proc near        test ax,8000h    JZ p    neg ax        mov cx,ax    mov dx,2dh    mov ah,2    int  21h    mov ax,cx    mov dx,0p:    mov bx,ten     Div bx    mov bx,dx    mov dx,ax    add dx,30h    mov ah,02h    int  21h    mov dx,bx    add dx,30h    mov ah,02h    int  21h    retprintit ENDP

DIV CX this directive, which is the 32bit value of the Dx:ax combined with the 16bit value of CX, the result of division must be expressed in 16bit, so it can be concluded that if the value of DX is larger than CX before this instruction is executed, it will overflow regardless of whether CX is 0. I guess your intention is to do ax divided by CX, so as long as the first DX cleared 0 on the line.

assembly language, displaying numbers in 10-binary fashion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.