[计算机类试卷]PC技术机试模拟试卷33及答案与解析.doc

上传人:sofeeling205 文档编号:493446 上传时间:2018-11-28 格式:DOC 页数:4 大小:27KB
下载 相关 举报
[计算机类试卷]PC技术机试模拟试卷33及答案与解析.doc_第1页
第1页 / 共4页
[计算机类试卷]PC技术机试模拟试卷33及答案与解析.doc_第2页
第2页 / 共4页
[计算机类试卷]PC技术机试模拟试卷33及答案与解析.doc_第3页
第3页 / 共4页
[计算机类试卷]PC技术机试模拟试卷33及答案与解析.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、PC技术机试模拟试卷 33及答案与解析 一、程序设计题 1 请编制程序 PROG1.ASM,其功能是:将内存中的 20个有符号字节数据依次除以 5,并按照四舍五入原则 (即余数绝对值的 2倍小于除数,则舍去 )将商存入指定的内存区域。 例如: 内存中有: 10H,01H,27H,00H,FFH,FSH, 结果为: 03H,00H,08H,00H,00H,FEH, 部分程序已给出,其中原始数据由过程 LOAD从文件 INPUT1.DAT中读入SOURCE开始的内存单元中,运算结果要求从 RESULT开始存放,由过程 SAVE保存到文件 OUTPUT1.DAT中。 填空 BEGIN和 END之间已

2、给出的源程序使其完整 (空白已用横线标出,每行空白一般只需一条指令,但采用功能相当的多条指令亦可 ),或删除 BEGIN和 END之间原有的代码并自行编程来完成要求的功能。 对程序必须进行汇编,并与 IO.OBJ链接产生 PROG1.EXE执行文件,最终运行程序产生结果 (无结果或结果不正确者均不得分 )。调试中若发现整个程序中存在错误之处,请加以修改。 试题程序: EXTRN LOAD:FAR,SAVE:FAR N EQU 20 X EQU 5 DSEG SEGMENT SOURCE DB N DUP(?) RESULT DB N DUP(0) NAME0 DB INPUT1.DAT,0 N

3、AME1 DB OUTPUT1.DAT,0 DSEG ENDS SSEG SEGMENT STACK DB 256 DUP (?) SSEG ENDS CSEG SEGMENT ASSUME CS:CSEC, SS:SSEC, DS:DSEG START PROC FAR PUSH DS XOR AX,AX PUSH AX MOV AX,DSEG MOV DS,AX MOV ES,AX LEA DX,SOURCE LEA SI,NAME0 MOV CX,N CALL LOAD ; * BEGIN * LEA SI,SOURCE LEA DI,RESULT CONT: LODSB CBW MOV

4、 DL,X IDIV DL (1) ; 余数为负数吗 JNS PLUS (2) ; 求绝对值 ADD AH,AH CMP AH,DL JB (3) SUB AL,1 JMP NEXT PLUS: ADD (4) CMP AH,DL JB NEXT (5) NEXT: STOSB CMP SI,N JB CONT ; * END * LEA DX,RESULT LEA SI,NAME 1 MOV CX,N CALL SAVE RET START ENDP CSEG ENDS END START PC技术机试模拟试卷 33答案与解析 一、程序设计题 1 【正确答案】 (1)CMP AH,0 (2) NEG AH (3) NEXT(4) AH,AH (5) ADD AL,1 【试题解析】 每个数除以 5之后首先判断余数是否为负,即比较 AH与零;如果为负,要将 AH中的值用 NEG指令取绝对值后再执行后续操作,即计算余数绝对值的两倍,若小于商直接舍去 (四舍 ),跳至 NEXT(第 3空 )执行存储操作,否则加一 (第五空,五入 )后存储。

展开阅读全文
相关资源
猜你喜欢
  • BS PD ISO TR 16786-2015 Intelligent transport systems The use of simulation models for evaluation of traffic management systems Input parameters and reporting template for simulati.pdf BS PD ISO TR 16786-2015 Intelligent transport systems The use of simulation models for evaluation of traffic management systems Input parameters and reporting template for simulati.pdf
  • BS PD ISO TR 17243-1-2014 Machine tool spindles Evaluation of machine tool spindle vibrations by measurements on spindle housing Spindles with rolling element bearings and integral.pdf BS PD ISO TR 17243-1-2014 Machine tool spindles Evaluation of machine tool spindle vibrations by measurements on spindle housing Spindles with rolling element bearings and integral.pdf
  • BS PD ISO TR 17321-3-2017 Graphic technology and photography Colour characterization of digital still cameras (DSCs) User controls and readouts for scene-referred imaging applicati.pdf BS PD ISO TR 17321-3-2017 Graphic technology and photography Colour characterization of digital still cameras (DSCs) User controls and readouts for scene-referred imaging applicati.pdf
  • BS PD ISO TR 18637-2016 Nanotechnologies Overview of available frameworks for the development of occupational exposure limits and bands for nano-objects and their aggregates and ag.pdf BS PD ISO TR 18637-2016 Nanotechnologies Overview of available frameworks for the development of occupational exposure limits and bands for nano-objects and their aggregates and ag.pdf
  • BS PD ISO TR 19024-2016 Evaluation of CPB devices relative to their capabilities of reducing the transmission of gaseous microemboli (GME) to a patient during cardiopulmonary bypas.pdf BS PD ISO TR 19024-2016 Evaluation of CPB devices relative to their capabilities of reducing the transmission of gaseous microemboli (GME) to a patient during cardiopulmonary bypas.pdf
  • BS PD ISO TR 19478-2-2015 ISO and Health Canada intense smoking parameters Examination of factors contributing to variability in the routine measurement of TPM water and NFDPM smok.pdf BS PD ISO TR 19478-2-2015 ISO and Health Canada intense smoking parameters Examination of factors contributing to variability in the routine measurement of TPM water and NFDPM smok.pdf
  • BS PD ISO TR 19686-100-2016 Petroleum products Equivalency of test method determining the same property Background and principle of the comparison and the evaluation of equivalency.pdf BS PD ISO TR 19686-100-2016 Petroleum products Equivalency of test method determining the same property Background and principle of the comparison and the evaluation of equivalency.pdf
  • BS PD ISO TR 21074-2016 Application of ISO 5725 for the determination of repeatability and reproducibility of precision tests performed in standardization work for chemical analysi.pdf BS PD ISO TR 21074-2016 Application of ISO 5725 for the determination of repeatability and reproducibility of precision tests performed in standardization work for chemical analysi.pdf
  • BS PD ISO TR 24097-2-2015 Intelligent transport systems Using web services (machine-machine delivery) for ITS service delivery Elaboration of interoperable web services' interfaces.pdf BS PD ISO TR 24097-2-2015 Intelligent transport systems Using web services (machine-machine delivery) for ITS service delivery Elaboration of interoperable web services' interfaces.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1