Compile learning notes-mark register

Source: Internet
Author: User

Instance: converts lowercase letters in a string ending with 0 to uppercase letters.

Assume Cs: code, DS: datadata segment DB "Beginner's all-purpose Symbolic Instruction Code.", 0; double quotation marks ?? Data ends: converts lowercase letters in a string ending with 0 to uppercase letters. The parameter: DS: Si points to the first address of the string: code segment start: mov ax, data mov ds, ax mov Si, 0 call letterc mov ax, 4c00h int 21 hletterc: push ax; Register into Stack S: mov Al, [Si]; read characters CMP Al from memory, 0 je OK; if the value is 0, the child ends.ProgramCMP Al, 61 h jb next; if it is smaller than a, next CMP Al, 7ah ja next; if it is greater than Z, next sub Al, 20 h mov [Si], Al; reduce lowercase letters by 20 h and write them to memory in upper case: Next: Inc Si JMP short S; read the next character: OK: Pop ax; register the stack RET code endsend start

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.