更灵活的定位内存地址的方法——大小写转换

October 4, 2013
masm

如下:

;BasiC to BASIC
;MinIX to minix
assume cs:code, ds:data
data segment
    db 'BaSiC'
    db 'MinIX'
data ends
code segment
start:
    mov ax, data
    mov ds, ax
    mov bx, 0
    mov cx, 5
s:
    mov al, 0[bx]
    and al, 11011111b
    mov 0[bx], al
    mov al, 5[bx]
    or al, 00100000b
    mov 5[bx], al
    inc bx
    loop s

    mov ax, 4c00h
    int 21h
code ends
end start

很简单的一个程序。

comments powered by Disqus