Assembler: displays the ASCII code of the input characters on the keyboard in binary format.

Source: Internet
Author: User

0f92: 0100 mov ah, 1; select dos API 01h Function

0f92: 0102 int 21 h; call 21h interrupt wait for keyboard input

0f92: 0104 mov CX, 8; 8 digits need to be processed

0f92: 0107 mov BH, 80; BH registers are placed into B

0f92: 0109 mov DH, Al; DH

0f92: 010b mov DL, 30; dl place 0 ASCII code 30 h

0f92: 010d and Al, BH; the input ASCII code is equal to B and the leftmost character is retained

0f92: 010f JZ 113

0f92: 0111 mov DL, 31; if the leftmost is 1, the DL is placed with the ASCII code 31 H of Character 1

0f92: 0113 mov ah, 2; select the dos api's 02h Function

0f92: 0115 int 21 h; call 21h interrupt to display the characters in the DL register

0f92: 0117 mov Al, DH; copy of input characters in the Al register

0f92: 0119 shr bh, 1; right shift 1 on the far left of BH

0f92: 011b loop 10B; returns 010bh, processing the ASCII code bit6 bits

0f92: 011d INT 20 h; process all eight digits and end the program

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.