内部中断服务程序


stack     segment
	db 1024 dup(?)
stack     ends

data      segment
	intoff  dw ?
	intseg   dw ?
data      ends

code      segment
	assume cs:code,ss:stack,ds:data
	
start:    mov ax,3580h
          int 21h
          mov intoff,bx
          mov intseg,es
          push ds
          mov dx,offset newint80h
          mov ax,seg newint80h
          mov ds,ax
          mov ax,2580h
          int 21h
          pop ds
          ;
          int 80h
          ;
          mov dx,intoff
          mov ax,intseg
          mov ds,ax
          mov ax,2580h
          int 21h
          mov ah,4ch
          int 21h
          
          
          ;子程序
          newint80h  proc
           sti
           push ax
           push bx
           push cx
           push si
           mov si,offset intmsg
           mov cx,sizeof intmsg
disp:      mov al,cs:[si]
           mov bx,0
           mov ah,0eh
           int 10h
           inc si
           loop disp
           pop si
           pop cx
           pop bx
           pop ax
           iret        ;中断返回
intmsg    db 'I am the best!',0dh,0ah
newint80h  endp

code      ends
end       start
          

你可能感兴趣的:(汇编)