Assembly Language Program: 16 binary conversion to 10 binary (three methods)

Source: Internet
Author: User

Assembly Language Program: 16 binary conversion to 10 binary (three methods)

1 ;Tianshui Rogue (Gouki Jiang), 16 binary to10 input Example 2007.5.182 stack SEGMENT PARA stack3 S_area DW 100H DUP (?)4 s_top EQU $-s_area5 STACK ENDS6  7 DATA SEGMENT PARA8VALUE DW 0eb9ah;0603149RESULT DB5DUP (?),'$'Ten DATA ENDS One   A CODE SEGMENT PARA -AssumeCS:CODE,DS:DATA,SS:STACK -   the MAIN PROC far -         MOVAx,data -         MOVDs,ax -         MOVAx,stack +         MOVSs,ax -         MOVSp,s_top +         MOVCX,5 A         MOVAx,value at         MOVBxTen -         MOVDi,offset result+4 -   - JYB:    XORDX,DX -         DIVBX -         ORdl,30h in         MOVBYTE PTR [Di],dl -         DECDI to LOOP JYB +         MOVDx,offset RESULT -         MOVAH,9 the         INT21H *   $ EXIT:   MOVax,4c00hPanax Notoginseng         INT21H - MAIN ENDP the CODE ENDS + END MAIN A   the ;--------------------------------------------- +   - ;Tianshui Rogue (Gouki Jiang), 16 binary to10 binary inverted 2007.5.18 $ stack SEGMENT PARA stack $ DW 100H DUP (?) - STACK ENDS -   the DATA SEGMENT PARA -VALUE DW 0eb9ah;060314Wuyi DATA ENDS the   - CODE SEGMENT PARA WuAssumeCS:CODE,DS:DATA,SS:STACK -   About MAIN PROC far $         MOVAx,data -         MOVDs,ax -         MOVCX,5 -         MOVAx,value A         MOVBxTen +   the JYB1:   XORDX,DX -         DIVBX $         ORdl,30h the         PUSHDX the LOOP JYB1 the         MOVCX,5 the JYB2:   POPDX -         MOVAH,2 in         INT21H the LOOP JYB2 the EXIT:   MOVax,4c00h About         INT21H the MAIN ENDP the CODE ENDS the END MAIN + ;----------------------------------------------- -   the ;Tianshui Rogue (Gouki Jiang), 16 binary to10 in -Process de-2007.5.18Bayi stack SEGMENT PARA stack the DW 100H DUP (?) the STACK ENDS -   - DATA SEGMENT PARA theVALUE DW 0eb9ah;060314 theDIVISOR DW10000, +, -,Ten,1 the DATA ENDS the   - CODE SEGMENT PARA theAssumeCS:CODE,DS:DATA,SS:STACK the   the MAIN PROC far94         MOVAx,data the         MOVDs,ax the         MOVCX,5 the         MOVAx,value98         MOVSi,offset DIVISOR About   - JYB:    XORDX,DX101         DIVWORD Ptr[si]102         PUSHDX103         ORal,30h104         MOVDl,al the         MOVAH,2106         INT21H107         INCSI108         INCSI109         POPAX the LOOP JYB111   the EXIT:   MOVax,4c00h113         INT21H the MAIN ENDP the CODE ENDS the END MAIN117  118 ;-------------------------------------

Original address: http://blog.sina.com.cn/s/blog_4a9fe761010008mq.html

Assembly Language Program: 16 binary conversion to 10 binary (three methods)

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.