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
|