- 1、本文档共5页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
实验四 系统功能调用
实验四 系统功能调用
一、实验目的:
1掌握DOS系统功能调用的方法,验证常用的系统功能调用的功能。
2学习利用系统功能调用进行程序设计。
二、实验内容:
系统功能调用的方法:
(1)传送入口参数到指定寄存器中;
(2)功能号送入AH寄存器中;
(3)INT 21H。
例如:实现从键盘输入单字符:
MOV AH,1
INT 21H …;结果在AL中
学会使用下列常用的系统功能调用,并逐一验证它们的功能:
(1)键盘输入单字符(1号系统功能调用);
(2)键盘输入字符串(0AH号系统功能调用);
(3)输出单字符(2号系统功能调用);
(4)输出字符串(9号系统功能调用);
(5)无回显键盘输入单字符(8号系统功能调用);
(6)返回操作系统(4CH号系统功能调用)。
编制一段完整的程序,实现下列功能:
从键盘输入一串大写字母,将其转换为小写字母并在屏幕上显示出来。
(提示:使用0AH和9号系统功能调用)。
三、实验步骤:
1、编制程序;
2、编译程序;
3、连接程序;
4、调试程序;
5、运行程序并察看结果。
四、实验程序设计:
例1:系统功能调用
sta segment stack
s1 dw 100 dup(?)
sta ends
data segment
buf db 20
db ?
db 20 dup(?)
db $
data ends
code segment
assume cs:code,ds:data
org 100h
start proc far
push ds
xor ax,ax
push ax
mov ax,data
mov ds,ax
;no.1 dos system function call,input single character from keyboard
mov ah,1
int 21h
;no.2 dos system function call,output single character
mov dl,al
mov ah,2
int 21h
;CR and LF
mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
mov ah,2
int 21h
;no.0ah dos system function call, input string from keyboard
mov dx,offset buf
mov ah,0ah
int 21h
;CR and LF
mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
mov ah,2
int 21h
;no.9 dos system function call,output string to keyboard
mov dx,offset buf+2
mov ah,9
int 21h
;CR and LF
mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
mov ah,2
int 21h
;no.8 dos system function call,input single character from keyboard but not display on the screen
mov ah,8
int 21h
;no.2 dos system function call,output single character
mov dl,al
mov ah,2
int 21h
;to pause program execution for us to observe the result
mov ah,1
int 21h
;no.4ch dos system function call,return operating system
mov ah,4ch
int
文档评论(0)