问题 问答题

请编制程序PROG1.ASM,其功能是:内存中连续存放的20个8位有符号数(补码)是由一个8位A/D转换器采集的双极性信号(Xn),现要求对该信号作如下限幅处理(处理后的信号记为Yn):
a) Yn=-100Xn<-100
b) Yn=Xn∣Xn∣≤100
c) Yn=100Xn>100
例如:
Xn:68H,60H,8EH,38H,…
Yn:64H,61H,9CH,38H,…
部分程序已在PROG1.ASM中给出,请填空BEGIN和END之间已给出的源程序使其完整(空白己用横线标出,每行空白一般只需一条指令,但功能相当的多条指令亦可)或删除 BEGIN和END之间原有的代码并自行编写程序片段来完成要求的功能。
原始数据由过程LOAD从文件INPUT1.DAT中读入SOURCE开始的内存单元中,结果要求从RESULT开始存放,由过程SAVE保存到文件OUTPUT1.DAT中。
对程序必须进行汇编,并与IO.OBJ链接产生PROG1.EXE执行文件,最终运行程序产生结果(无结果或结果不正确者均不得分)。
试题程序:
EXTRN LOAD:FAR, SAVE:FAR
N EQU20
M EQU100
DSEGSEGMENT
SOURCE DWN DUP()
RESULT DWN DUP(0)
NAME0 DB’INPUTI.DAT’,0
NAME1 DB’OUTPUT1.DAT’,0
DSEGENDS
SSEGSEGMENT STACK
DB128 DUP()
SSEGENDS
CSEGSEGMENT
ASSUME CS:CSEG, DS:DSEG, SS:SSEG
START PROC FAR
PUSH DS
XORAX,AX
PUSH AX
MOVAX,DSEG
MOVDS,AX
LEADX,SOURCE; 数据区起始地址
LEASI,NAME0; 原始数据文件名起始地址
MOVCX,N ; 字节数
CALL LOAD ; 从INPUT1.DAT中读取数据
; **** BEGIN ****
LEASI,SOURCE
LEADI,RESULT
(1)
NEXT: MOVAX,[SI]
CMPAX,-M
(2) L1
CMPAL,M
(3)
MOVAL,M
JMPL2
L1:MOVAL,-M
L2:MOV[DI],AL
(4)
(5)
(6)
; **** END ****
LEA DX,RESULT ; 结果数据区首址
LEA SI,NAME1 ; 结果文件名起始地址
MOV CX,N ; 字节数
CALL SAVE ; 保存结果到OUTPUT1.DAT文件中
RET
START ENDP
CSEGENDS
END START

答案

参考答案:

 (A) MOV CX,B0 (B) JL (C) JL LB

(D) ADD SI,I (E) ADD DI,A (F) LOOP NEXT

解析:

本题要求对20个数进行循环转换,但本题中没有设置计数器,所以应该在循环体前面的一个空白处设置计数器。程序中,比较指令后通常是转移指令,需要考虑一个比较操作后应做如何处理。在一个数据处理完毕并存入目的地址后,应准备处理下—个数据,所以应修改源操作数地址和目的操作数地址,并回到循环体开始部分重新进行操作。

单项选择题
阅读理解

阅读理解。

     Do you still remember your favorite poem from high school or some other important periods in your

life? Why is it that decades later it still stands out in your mind? Probably the main reason is that some

aspect of that poem resonates (引起共鸣) with you. In the same way, you too as a school leader can

touch the hearts of your staff and students.

     Poetry allows us to experience strong spiritual connections to things around us and to the past. The

power that poetry has displayed over time and across cultures actually satisfies this common need of the

human heart and soul.

     As one of the oldest art forms, poetry has successfully connected various strands of humanity (人性)

from one generation to another. Referring to poetry, Hillyer makes a simple yet meaningful statement,

"With this key mankind unlocked his heart."

     School leaders can find and make use of the value of poetry for themselves, their students and their

staff members. Beyond the simple use of poetry, techniques of poetry such as metaphors, repetitions and

imagery can be used o take advantage of the power of language to transform communication, create

meaning and a culture of care and attention.

     Since schools are mainly about people and relationships, school leaders, like poets, are required to

inspire and encourage the human heart. The use of poetry-or even of some techniques of poetry-in

school leadership not only helps to improve communication, but also serves to meet the human need for

inspiration.

1. The underlined part "this common need" in the second paragraph refers to ____.

A. the need to read poetry

B. the need to be inspired

C. the need to learn about the past

D. the need to be connected with other people

2. The use of poetry or techniques of poetry in school leadership is in fact to make use of _____.

A. the power of language

B. the power of school leaders

C. people's preference for poetry

D. people's desire for communication

3. What is the purpose of this passage?

A. To show the readers that poetry is really powerful.

B. To explain how poetry can be used in our daily life.

C. To talk about the art of being a school leader.

D. To encourage using the transformational power of poetry in school leadership.