汇编ASCII大小写转换(字符串长度$的用法)

data segment    
     first db "BaSiC"
     db "iNfOrMaTiOn"
     len equ $-first        ;×Ö·û´®³¤¶È
ends

code segment
start:
    mov ax, data
    mov ds, ax
        
    mov cx,len
    xor bx,bx
    s:       
    ;or [bx],20h     ;תΪСд
    and [bx],11011111b    ;תΪ´óд
    inc bx    
    loop s
    
        
    ;lea dx, pkey
    ;mov ah, 9
    ;int 21h        ; output string at ds:dx
    
    ; wait for any key....    
    ;mov ah, 1
    ;int 21h
    
    mov ax, 4c00h ; exit to operating system.
    int 21h    
ends

end start ; set entry point and stop the assembler.

 

posted @ 2015-04-22 18:10  庚武  Views(531)  Comments(0Edit  收藏  举报