Assembly 4. Ax content is sorted sequentially

Source: Internet
Author: User
;P99,5.13,ax内容倒序;思路,ax左移一位最高位进cf里,bx右移一位把cf里值进bx的最高位,;循环16次即实现ax16位内容倒序存储在bx中DATA SEGMENTDATA ENDSCODE SEGMENT    ASSUME CS:CODE,DS:DATA START:     MOV AX,DATA    MOV DS,AX    MOV AX,1011100011110000B            ;B8F0    MOV CX,16;测试条件   AX,0000111100011101B        ;OF1D XH:    RCL AX,1    RCR BX,1    LOOP XH    MOV AX,BX    MOV AH,4CH    INT 21HCODE ENDS END START
Code prototypes
CODE SEGMENT ASSUME CS:CODESTART:    MOV AL,00000001B    MOV CX,8 XH:    RCL AL,1    ;AL带进位循环左移,第一次把一个数放到cf寄存器中    RCR AH,1    ;ah带进位循环右移,刚好把cf寄存器中al的值移到ah的最低位    LOOP XH     ;通过cx次循环,刚刚好实现al的数在ah中反序排列    MOV AL,AH   ;ah中的数复制到al中,实现本实验的目的:al的数反向    MOV AH,4CH    INT 21HCODE ENDSEND START

Assembly 4. Ax content is sorted sequentially

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.