收藏 分销(赏)

实验四-系统功能调用.doc

上传人:仙人****88 文档编号:8890600 上传时间:2025-03-06 格式:DOC 页数:6 大小:41.50KB
下载 相关 举报
实验四-系统功能调用.doc_第1页
第1页 / 共6页
实验四-系统功能调用.doc_第2页
第2页 / 共6页
点击查看更多>>
资源描述
实验四 系统功能调用 一、实验目的: 1掌握DOS系统功能调用的方法,验证常用的系统功能调用的功能。 2学习利用系统功能调用进行程序设计。 二、实验内容: 1、 系统功能调用的方法: (1)传送入口参数到指定寄存器中; (2)功能号送入AH寄存器中; (3)INT 21H。 例如:实现从键盘输入单字符: MOV AH,1 INT 21H …;结果在AL中 学会使用下列常用的系统功能调用,并逐一验证它们的功能: (1)键盘输入单字符(1号系统功能调用); (2)键盘输入字符串(0AH号系统功能调用); (3)输出单字符(2号系统功能调用); (4)输出字符串(9号系统功能调用); (5)无回显键盘输入单字符(8号系统功能调用); (6)返回操作系统(4CH号系统功能调用)。 2、 编制一段完整的程序,实现下列功能: 从键盘输入一串大写字母,将其转换为小写字母并在屏幕上显示出来。 (提示:使用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 21h start endp code ends end start 例2:从键盘输入一串大写字母,将其转换为小写字母并在屏幕上显示出来。 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 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 mov cx,19 lea si,buf+2 lp: mov bl,[si] add bl,20h mov [si],bl inc si loop lp mov dx,offset buf+2 mov ah,9 int 21h mov ah,1 int 21h ret start endp code ends end start 五:实验结果 1、程序1运行结果: AA ABCDEFGHIJKLMNOPQRS ABCDEFGHIJKLMNOPQRS T 2、程序2运行结果: ABCDEFGHIJKLMNOPQRS Abcdefghijklmnopqrs 6
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传
相似文档                                   自信AI助手自信AI助手

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服