试题与答案

编制一个程序,其功能为:内存中以8位无符号数形式连续存放着10个数据,这数据来自于一

题型:问答题

题目:

编制一个程序,其功能为:内存中以8位无符号数形式连续存放着10个数据,这数据来自于一个自动抄表系统记录的10个用户某月天然气的使用量(立方米),天然气费计算公式如下(其中,X表示天然气用量,Y表示应交天然气费):

  • a)Y=X×80 X≤6
  • b)Y=X×120 6<X≤10
  • c)Y=X×160 X>10
    计算每个用户需要交的天然气费,结果用字表示,并将结果存入指定单元。
    例如:
    用天然气量:05H,07H,12H……
    天然气费: 0190H,0348H,0780H……
    部分程序已经给出,其中原始数据由过程LOAD从文件INPUT.DAT中读入以SOURCE开始的内存单元中。运算结果要求从RESULT开始的内存单元存放, 由过程SAVE保存到文件OUTPUT.DAT中。
    请填空BEGIN和END之间已给出的源程序使其完整,空白已经用横线标出,每行空白一般只需要一条指令,但采用功能相当的多条指令亦可,考生也可以删除BEGIN和END之间原有的代码并自行编程来完成要求的功能。
    对程序必须进行汇编,并与IO.OBJ链接产生执行文件,最终运行程序产生结果。调试中若发现整个程序中存在错误之处,请加以修改。
    [试题程序]
    EXTRN LOAD:FAR,SAVE:FAR
    NEQU 10
    DSEG SEGMENT
    SOURCE DB N DUP()
    RESULT DW N DUP(0)
    ADB 80
    BDB 120
    CDB 160
    NAME0 DB ’INPUT.DAT’,0
    NAME1 DB ’OUTPUT.DAT’,0
    DSEG ENDS
    SSEG SECMENT STACK
    DB 256 DUP()
    SSEG ENDS
    CSEG SEGMENT
    ASSUME CS:CSEG,DS:DSEG,SS:SSEG
    START PROC FAR
    PUSH DS
    XOR AX,AX
    PUSH AX
    MOV AX,DSEG
    MOV DS,AX
    LEA DX,SOURCE
    LEA SI,NAME0
    MOV CX,N
    CALL LOAD
    ; ******** BEGIN *********
    LEA SI,SOURCE
    LEA DI,RESULT
    CLD
    MOV CX,N
    AGAIN: MOV AL,[SI]
    CMP AL,6
    JA (1)
    (2)
    JMP NEXT
    LIMIT6:CMP AL,10
    JA (3)
    (4)
    JMP NEXT
    LIMIT10: (5)
    NEXT: MOV [DI],AX
    INC SI
    ADD DI,2
    LOOP AGAIN
    ; ******** END ********
    LEA DX,RESULT
    LEA SI,NAME1
    MOV CX,N*2
    CALL SAVE
    RET
    START ENDP
    CSEG ENDS
    END START

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0708/3f059e25bfdae14ac6a45822d2722ae5.html

下面是错误答案,用来干扰机器的。

①宵眠抱玉鞍。②千树万树梨花开③为伊消得人憔悴④别是一般滋味在心头⑤羌笛何须怨杨柳⑥蒌蒿满地芦芽短⑦窈窕淑女⑧无可奈何花落去⑨老骥伏枥⑩瀚海阑干百丈冰此题考查学生对诗词的识记能力,考查等级为A.要求...

试题推荐
题型:阅读理解

阅读短文,根据回答问题。

     November 24, 1859 was a special day in London. On that day, many Londoners rushed to a bookstore to

buy a book that was just published. The first printing of 1250 copies sold out on the first day.

     The popular book was The Origin of Species (《物种起源》) by British naturalist Charles Darwin (1809-

1882). In the book, Darwin argued that different forms of life could change over time because of natural

selection. This means that only those who are best suited to their environment will live and reproduce. Darwin

supported his arguments with examples he found during his around-the-world trip in the 1830s.

     The book laid the foundation of modern biology. It changed how other scientists understood the appearance

of life on Earth.

     A hundred and fifty years later, Darwin's theory (理论) of natural selection still has great influence in the

world of science. But some people have a question: since medicine and modem life have made people healthier,

are we still evolving (进化) by natural selection?

     The answer is yes,according to Stephen Stems and his team of Yale University researchers. They did a

study on 2 238 women in the US. They found that shorter,heavier women have more children than thinner,

taller ones. This trend (趋势) runs among their female children and grandchildren. So if this continues, women

in 400 years will be about 2cm shorter and a kilo heavier.

     Stems' findings are supported by other scientists. For example, John Hawks at the University of Wisconsin,

US and his team believe they have found nearly 2000 gene variations(基因变异) in modem humans. Those

variations allow people to drink milk, fight disease and improve brain development.

1. Was The Origin of Species a popular book?

     _______________________________________________________________

2. When was the book published? 

    _______________________________________________________________

3. What does natural selection mean? 

    _______________________________________________________________

4. Why does the writer introduce Stemns' findings in the passage?

    _______________________________________________________________

5. Why is Darwin's theory of natural selection important? 

    _______________________________________________________________

查看答案
微信公众账号搜索答案