编写安装中断7ch的中断例程:将一个以0结尾的字符串,转化为大写
October 17, 2013
masm
中断的安装程序:
assume cs:code
code segment
start:
mov ax, cs
mov ds, ax
mov si, offset chstr
mov ax, 0
mov es, ax
mov di, 200h
mov cx, offset chstrend - offset chstr
cld
rep movsb
mov ax, 0
mov es, ax
mov word ptr es:[7ch * 4 + 0], 200h
mov word ptr es:[7ch * 4 + 2], 0
mov ax, 4c00h
int 21h
chstr:
mov si, 0
lh:
mov cx, 0
mov cl, [si]
jcxz ok
and byte ptr [si], 11011111b
inc si
jmp lh
ok:
iret
chstrend:
nop
code ends
end start
测试程序:
assume cs:code, ds:data
data segment
db 'conversation', 0
data ends
code segment
start:
mov ax, data
mov ds, ax
mov si, 0
int 7ch
mov ax, 4c00h
int 21h
code ends
end start
其实都是一个思路……
这货不难。