资源描述:
《北京理工大学微机原理汇编语言上机实验题》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验一请在数据段中定义两个数,要求编写程序分别计算出这两个数的和、差、积、商,并用Debug的相关命令查询计算结果。(略)实验二内存自TABLE开始的连续16个单元中存放着0-15的平方值,查表求DATA中任意数X(0≤X≤15)的平方值,并将结果放在RESULT中。DATA1SEGMENT TABLEDB0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225 DATADB10 RESULTDB? DATA1ENDS STACS
2、EGMENT DB100DUP(?) STACENDS CODESEGMENT ASSUMEDS:DATA1,SS:STAC,CS:CODESR:MOVAX,DATA1 MOVDS,AX MOVAX,STAC MOVSS,AX LEABX,TABLE MOVAH,0 MOVAL,DATA XLAT MOVRESULT,AL MOVAH,4CH INT21H CODEENDS ENDSR实验三试编写一程
3、序:比较两个字符串STRING1和STRING2所含的字符是否相同。若相同则显示‘MATCH’,否则显示‘NOMATCH’。DATA1SEGMENT STRING1DB10,?,10DUP(?) STRING2DB10,?,10DUP(?) REM1DB'PLEASEINPUTSTR1:$' REM2DB'PLEASEINPUTSTR2:$' MESS1DB'MATCH$' MESS2DB'NOMATCH$'DATA1ENDSCODE1 SEGMENT ASSU
4、MECS:CODE1,DS:DATA1 STT:MOVAX,DATA1 MOVDS,AX MOVES,AXLEADX,REM1MOVAH,09HINT21HLEADX,STRING1MOVAH,0AHINT21HMOVDL,0DHMOVAH,6INT21HMOVDL,0AHMOVAH,6INT21HLEADX,REM2MOVAH,09HINT21HLEADX,STRING2MOVAH,0AHINT21HMOVDL,0DHMOVAH,6INT21HMOVDL,0AHMO
5、VAH,6INT21HLEASI,STRING1 LEADI,STRING2 MOVCL,[SI+1] MOVBL,[DI+1] CMPCL,BL JNENOM CLD MOVCH,0 ADDCL,2 REPZCMPSB JNZNOMMAT:LEADX,MESS1 JMPSHORTDISP1NOM:LEADX,MESS2
6、DISP1:MOVAH,09H INT21H MOVAH,4CH INT21H CODE1ENDS ENDSTT实验四设有10个学生的成绩分别为:56,69,84,82,73,88,99,63,100,80分。试编写程序分别统计低于60分、60-69分、70-79分、80-89分、90-99分及100分的人数,并将各分数段的人数在屏幕上显示出来。DATASEGMENTSCOREDB56,69,84,82,7
7、3,88,99,63,100,80NUM_UNDER60DB0NUM_60TO69DB0NUM_70TO79DB0NUM_80TO89DB0NUM_90TO99DB0NUM_100DB0DATAENDS CODESEGMENTASSUMECS:CODE,DS:DATA START:MOVAX,DATAMOVDS,AXXORAX,AXMOVCX,10LEABX,SCORE COMPARE:CMPBYTEPTR[BX],60JLUNDER60JMPIS60TO69IS60TO69:CMPBYTEPTR[
8、BX],70JL_60TO69JMPIS70TO79IS70TO79:CMPBYTEPTR[BX],80JL_70TO79JMPIS80TO89IS80TO89:CMPBYTEPTR[BX],90JL_80TO89JMPIS90TO99IS90TO99:CMPBYTEPTR[BX],100JL_90TO99JZEQUAL100 UNDER60:ADDNUM_UNDER60,1JMPCON_60TO69:ADDNUM_60TO69,1JMPCON_70TO79:ADDN