试题与答案

请编制程序PROG1.ASM,其功能是:统计30个学生成绩中得分在100~90、89

题型:多项选择题

题目:

请编制程序PROG1.ASM,其功能是:统计30个学生成绩中得分在100~90、89~80、 79~70、69~60区间以及低于60分的人数,并计算30个学生的平均成绩(取整数),结果依次存入指定的内存区域。
例如:
内存中有10个分数; 5EH,50H,64H,52H,55H,48H,3AH,4AH,40H,42H
结果为:02H,03H,02H,02H,01H,4DH(平均成绩)
部分程序已给出,其中原始数据由过程LOAD从文件INPUT1.DAT中读入SOURCE开始的内存单元中。运算结果要求从RESULT开始存放,由过程SAVE保存到文件OUTPUT1.DAT中。
填空BEGIN和END之间已给出的源程序使其完整(空白已用横线标出,每行空白一般只需一条指令,但采用功能相当的多条指令亦可),或删除BEGIN和END之间原有的代码并自行编程来完成要求的功能。
对程序必须进行汇编,并与IO.OBJ链接产生PROG1.EXE执行文件,最终运行程序产生结果(无结果或结果不正确者均不得分)。调试中若发现整个程序中存在错误之处,请加以修改。
试题程序:
EXTRN LOAD:FAR, SAVE:FAR
N EQU30
L EQU5
DSEGSEGMENT
SOURCE DBN DUP()
RESULT DBN+1 DUP(0)
NAME0 DB’INPUT1. DAT’,0
NAME1 DB’OUTPUT1.DAT’,0
DSEGENDS
SSEGSEGMENT STACK
DB256 DUP()
SSEGENDS
CSEGSEGMENT

ASSUME
CS: CSEG, SS: SSEG, DS: DSEG
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

XOR
BX,BX


(1)


MOV
CX,N
GOON:
LODSB


(2)


ADD
BX,AX


(3)


JAE
A1

CMP
AL,80

JAE
A2

CMP
AL,70

JAE
A3

CMP
AL,60

JAE
A4

INC
(4)


(5)

A4:
INC
BYTE PTR [DI+3]

JMP
NEXTA3:
INC
BYTE PTR [DI+2]

JMP
NEXTA2:
INC
BYTE PTR [DI+1]

JMP
NEXTA1:
INC
BYTE PTR [DI]
NEXT:
LOOP
GOON

MOV
AX, (6)

MOV
DL, (7)

DIV
DL

MOV
[DI+5], AL
; *** END ***

LEA
DX, RESULT

LEA
SI, NAME1

MOV
CX, L+1

CALL
SAVE

RET
START
ENDP
CSEG
ENDS

END
START

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0606/94079ffb4a8720ac6064f8e06eb4c3de.html

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

参考答案:D解析:急性肺脓肿感染细菌包括革兰阳性球菌及厌氧菌,对青霉素敏感,首选青霉素,联合甲硝唑抗厌氧菌感染。

试题推荐
题型:完形填空

第三部分: 完型填空(共20小题;每小题1分,满分20分)

阅读下面短文,掌握其大意,然后从36—55各题所给的四个选项(A、B、C和D)中,选出最佳选项,并在机读卡上将该项标号涂黑。

My grandfather worked as a carpenter. One day, he was building some crates(木箱)for the

clothes his church was  41  to an orphanage(孤儿院)in Brazil. On his way home, he found his glasses  42 . When he  43  what he had done, he realized his glasses   44 out of his pocket and fallen into one of the crates. His new glasses were heading for  45  !

“It’s not  46  .” he thought as he walked home angrily. “I’ve been very faithful in giving  47  of my time and money to my work. And now his.” He felt a bit   48  .

Several months  49  , the director of the orphanage in Brazil came to the United States. He wanted to visit all the churches that supported him,   50  he came to my grandfather’s small  51  in Chicago.

He began  52  thanking the people for their  53 in supporting the orphanage. “But first of all,” he said, “I shall thank you for the glasses you sent   54  . You see, some people  55 into the orphanage, destroying everything my glasses  56  . Along with  57 able to see well, I experienced headaches. Then your crates arrived. When I   58  the covers, I found a pair of glasses lying on top.” “When I tried on the glasses,” he continued, “it  was  59  they had just been made for me!”

People listened, happy for the   60  glasses. Sitting quietly in the back ,with tears steaming down his face, my grandfather, an ordinary carpenter realized that his glasses had found a good place to go.

41.A.carrying     B.sending     C.taking       D.bringing

42.A.missing      B.broken      C.going D.missed

43.A.thought      B.repeated    C.remembered      D.reminded

44.A.can’t have slipped     B.must slip   C.can have slipped       D.must have slipped

45.A.Chicago     B.Brazil C.nowhere    D.his home

46.A.fair     B.worth C.valuable    D.worthy

47.A.either  B.none  C.all      D.any

48.A.excited       B.unhappy    C.discouraged      D.shocked

49.A.lately  B.late    C.latter  D.later

50.A.yet     B.then   C.nevertheless      D.so

51.A.school B.town  C.church       D.home

52.A.in       B.by      C.to      D.for

53.A.kindness     B.encouragement  C.inspiration D.honesty

54.A.last year     B.last month C.last week   D.last summer

55.A.has come    B.used to come     C.had come   D.come

56.A.to include   B.include      C.including   D.included

57.A.not to be    B.being C.not be       D.not being

58.A.opened       B.removed    C.moved       D.discovered

59.A.as though   B.even though      C.ever if       D.only if

60.A.exact  B.famous      C.wonderful  D.valuable

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