本文为《汇编语言程序设计》0701小节例程。点击链接…进课程主页。
例:汇编程序中字符的表示
assume cs:code, ds:data data segment db 'unIX' db 'foRK' data ends code segment start: mov al,'a' mov bl,'b' mov ax,4c00h int 21h code ends end start问题:对datasg中的字符串 - 第一个字符串:小写字母转换为大写字母 - 第二个字符串:大写字母转换为小写字母
assume cs:codesg,ds:datasg datasg segment db 'BaSiC' db 'iNfOrMaTiOn' datasg ends codesg segment start: mov ax,datasg mov ds,ax mov bx,0 mov cx,5 s: mov al,[bx] and al,11011111b mov [bx],al inc bx loop s mov bx,5 mov cx,11 s0: mov al,[bx] or al,00100000b mov [bx],al inc bx loop s0 mov ax,4c00h int 21h codesg ends end start 相关资源:python入门教程(PDF版)