assume cs:code,ds:data,ss:stack
stack segment
db 256 dup (?)
top label word
stack ends
data segment
db 'xiaonei',0
data ends
code segment
start:
mov ax,stack
mov ss,ax
mov sp,offset top
;将sqr程序到sqrend程序存入内存0:200处
mov ax,cs
mov ds,ax
mov si,offset converter
mov ax,0
mov es,ax
mov di,200H
mov cx,offset converterend - offset converter
cld
rep movsb
;安装向量表,安装到中断码为7c处
mov ax,0
mov es,ax
mov word ptr es:[7cH*4],200H
mov word ptr es:[7cH*4+2],0
int 7cH ;调用中断处理程序
mov ax,4c00H
int 21H
;将data段中的字符串"xiaonei"转换成大写
converter:
push cx ;将冲突的寄存器保存到栈中
mov ax,data
mov ds,ax
mov bx,0
s0:
mov cl,[bx]
mov ch,0
jcxz s1
and cl,0dfH
mov [bx],cl
inc bx
jmp short s0
s1:
pop cx
iret
converterend:
nop
code ends
end start
中断调用处理程序
最新推荐文章于 2024-02-23 14:05:19 发布