您现在的位置: 中国男护士网 >> 考试频道 >> 计算机等级 >> 一级辅导 >> 正文    
  利用直接定址表的中断处理程序 【注册男护士专用博客】          

利用直接定址表的中断处理程序

www.nanhushi.com     佚名   不详 

assume cs:codesg

datasg segment
    endl EQU <0dh,0ah>
    function0    db endl,"This Int 7ch function is:$"
    function1    db endl,"(1) Cls $"
    function2    db endl,"(2) Set FrontColor$"
    function3    db endl,"(3) Set BackColor$"
    function4    db endl,"(4) Scroll Up$"
    function5    db endl,"(5) Exit$"
    inputf        db endl,endl,"Please Input function number:$"
    inputc        db endl,endl,"Please Input color(0-8):$"
    errors        db endl,endl,"Input Error!Please Input the number(1-5),color(0-8)",endl,endl,’$’
datasg ends
    
stack segment
    dw 16 dup (0)
stack ends

codesg segment
    
start:
    mov ax,stack
    mov ss,ax
    mov sp,32
    mov ax,datasg
    mov ds,ax
;/**////////////////////////////////////////////////
;安装int 7ch中断处理程序
    mov ax,0
    mov es,ax
    cli 
    mov word ptr es:[7ch*4],offset setscreen
    mov es:[7ch*4+2],cs
    sti
;/**/////////////////////////////////////////////////
    int 7ch

    mov ax,4c00h
    int 21h

;/**/////////////////////////////////////////////////
;int 7ch中断处理程序代码

setscreen:
    jmp short showfc
table:    
    dw 0,sub1,sub2,sub3,sub4   ;直接定值表,第一个0为补充地址,使得输入1调用sub1。

showfc:
    push ax
    push dx
    push bx
    push cx

;显示功能提示
showfc1:
    mov ah,9    ;int 21h 9号功能为在标准输出上显示以$结尾的字符串,DS:DX指向字符串偏移地址。
    mov dx,offset function0
    int 21h
    mov dx,offset function1
    int 21h
    mov dx,offset function2
    int 21h
    mov dx,offset function3
    int 21h
    mov dx,offset function4
    int 21h
    mov dx,offset function5
    int 21h

    mov dx,offset inputf
    int 21h

 

文章录入:杜斌    责任编辑:杜斌 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
     

    联 系 信 息
    QQ:88236621
    电话:15853773350
    E-Mail:malenurse@163.com
    免费发布招聘信息
    做中国最专业男护士门户网站
    最 新 热 门
    最 新 推 荐
    相 关 文 章
    2011年护士资格考试:考…
    2009年初级护士资格考试…
    2009年主管护师考试于12…
    2009年初级护士考试于12…
    2009年初级护师考试于12…
    石家庄市关于2009年度护…
    2009年护士专业技术资格…
    医护技能考试周末举行 4…
    护士“托福”今年7月开考
    护士“托福”考试开始报…
    专 题 栏 目