汇编实验14Word格式.docx
《汇编实验14Word格式.docx》由会员分享,可在线阅读,更多相关《汇编实验14Word格式.docx(14页珍藏版)》请在冰点文库上搜索。
DATA'
;
addyourdatahere!
resdb0,0,0,'
time:
'
mindb0,0,'
min'
secdb0,0,'
sec'
10,13,'
$'
timesdb0,0
string1db'
WelcomeBABY!
13,10,36
string2db'
1toQUIT'
string3db'
2TOstart'
string4db'
No'
string5db0
string6db'
Pleasewritesuchsentences'
thedefinitionofthesentences
note0db'
Hello!
Theme'
note1db'
abcdefghigklm'
note2db'
whatareyouns'
note3db'
aaaaaaaaaa'
note4db'
bbbbbbbbbbbbb'
note5db'
ccccccccccccc'
note6db'
globalhis'
note7db'
mmmmmmmmmmmmmm'
note8db'
kkkkkkkkkkkkk'
note9db'
nnnnnnnnnnnnn'
lengthListdb13,13,14,10,14,13,11,12,13,13
outmsgdb'
Yourgradeis'
36
spacedb13,10
scoredb0
string6Timedw10
guangbiaomacrox,y//清屏
pushdx
pushbx
movdl,x
movdh,y
movbh,0
movah,02h;
置光标位置BH=显示页号;
DH:
DL=行:
列
int10h
popbx
popdx
endm
outputstrmacrostring
leadx,string
movah,09h
int21h
endm
DSEGENDS
SSEGSEGMENTSTACK'
STACK'
db256DUP(0)
SSEGENDS
CSEGSEGMENT'
CODE'
STARTPROCFAR
setsegmentregisters:
MOVAX,DSEG
MOVDS,AX
MOVES,AX
addyourcodehere
callDtishiyuju;
//输出提示性语句
yaoqiu:
movah,0;
//键盘功能调用,读键盘
int16h
cmpal,'
1'
jzs0
2'
jzs1
jmps2
s1:
callexercise
movah,1
int21h
jmps0
s2:
guangbiao1,20
outputstrstring4
jmpyaoqiu
s0:
movah,4ch
xoral,al
end:
;
////读取时间
movah,2ch
subcl,times
subdh,times+1
movtimes,cl
movtimes+1,dh
MOVAX,4C00h;
exittooperatingsystem.
INT21h
STARTENDP
DrawUIproc
;
cleartheentirescreen
pushax
pushdx
pushbx
pushcx
movah,07h
moval,0
movcl,0
movch,0
movbh,7
movdh,25
movdl,80
int10h
popcx
popbx
popdx
popax
ret
DrawUIendp
Dtishiyujuproc
todrawthewelcomeinterface
guangbiao22
outputstrstring1
guangbiao12,8
outputstrstring3
guangbiao12,12
outputstrstring2;
/////将提示性语句输出来
ret
Dtishiyujuendp
exerciseproc
mov[score],0
leasi,note0
subsi,3
ex:
dec[string6Time]
callDrawUI
guangbiao0,0
leadx,string6
movah,09h
addsi,3
guangbiao12,10
movdx,si
leadi,lengthList
adddi,string6Time
movcl,[di]
movch,0
guangbiao11,15
xordx,dx
judge:
movah,01h
cmp[si],al
jzaddpoint
cmpal,1bh
jz.endexercise
jmp.conti
addpoint:
incdl
jmp.conti
.conti:
incsi
loopjudge
add[score],dl
cmp[string6Time],0
jz.endexercise
jmpEX
.endexercise:
calldisplayresult
ret
exerciseendp
displayresultproc
callDrawUI///分数
cmpscore,100
jgeB1
cmpscore,90
jgeB2
cmpscore,80
jgeB3
cmpscore,70
jgeB4
jmpB5
B1:
movdl,'
A'
jmpoutput
B2:
B'
B3:
C'
B4:
D'
B5:
E'
output:
pushdx
leadx,outmsg
movah,09h
int21h
popdx
movah,02h
displayresultendp
CSEGENDS
ENDSTART;
setentrypoint.
四、结果分析(对输入\输出部分截屏)
五、实验总结
十个打字练习的截图较多,因为是打一句,然后屏幕就清屏,于是就只截了几个