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

文章作者 100test 发表时间 2007:11:14 12:19:04
来源 100Test.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


相关文章


SQL语句基础学习WHERE
通过汇编代码理解成员函数指针并不是指针
SQL语句基础学习SELECT
利用直接定址表的中断处理程序
汇编程序在屏幕显示字符的源代码
青海:2007年9月计算机等级考试成绩查询开始
贵州:2007年9月计算机等级考试成绩查询开始
福建:2007年9月计算机等级考试成绩查询开始
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛