资源描述:
《微机原理实验程序中国石油大学(华东).doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、.实验3循环程序设计实验内容:1.数组X,Y,Z,。X=32,-43,76,95,-1;Y=-78,127,-128,-125,88。计算两数之和,送入数组S。DATASEGMENTXDB32,-43,76,95,-1YDB-78,127,-128,-125,88SDB5DUP(0)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVCX,5MOVSI,0FOR:MOVAL,X[SI]ADDAL,Y[SI]MOVS[SI],ALIN
2、CSILOOPFORCODEENDSENDSTART2.两个多位十进制数,X=1357902468,Y=5790123467。计算两数之和(BCD码)。DATASEGMENTXDB68H,24H,90H,57H,13HYDB67H,34H,12H,90H,57HSDB5DUP(0)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVCX,5MOVSI,0CLCFOR:MOVAL,X[SI]ADDAL,Y[SI]DAAMOVS[SI]
3、,ALINCSILOOPFORCODEENDSWord文档.ENDSTART实验4子程序调用变成设计实验内容:用子程序调用方法,现有数组X=32,-43,76,95,-1,-78,127,-128,-125,88 编程按递增顺序排序输出。DATASEGMENTXDB32,-43,76,95,-1,-78,127,-128,-125,88ENDSSEGMENTCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXCALLSUB1MOVAH,
4、4CHINT21HSUB1PROCNEARMOVCX,9LP1:MOVBX,0MOVDX,CXLP2;MOVAL,X[BX]CMPAL,X[BX+1]JLENEXTXCHGAL,X[BX+1]NEXT:INCBXDECDXJNELP2LOOPLP1RETSUB1ENDPCODEENDSENDSTART实验5DOS功能调用实验内容:1.从键盘连续输入五个单个字符,然后再反向输出这5个字符。输入:12345输出:54321CODESEGMENTASSUMECS:CODEWord文档.START:MOVCX,5LP1:
5、MOVAH,01INT21HPUSHAXLOOPLP1MOVDL,0AHMOVAH,02INT21HMOVDL,0DHMOVAH,02INT21HMOVCX,5LP2:POPDXMOVAH,02INT21HLOOPLP2MOVAH,4CHINT21HCODEENDSENDSTART2.从键盘输入一串字符“abcde”,然后输出3次。DATASEGMENTMAXDB10STRDB10DUP(‘S’)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOV
6、DS,AXLEADX,MAXMOVAH,10INT21HMOVCX,3LP:LEADX,STRMOVAH,9INT21HWord文档.MOVDL,0DHMOVAH,02HINT21HMOVDL,0AHMOVAH,2INT21HLOOPLPMOVAH,4CHINT21HCODEENDSENDSTART实验10简单的输出接口实验实验内容;1.利用74LS75设计一个接口电路,使4个LED同时亮,同时灭,中间间隔1秒,共循环5次。CODESEGMENTASSUMECS:CODESTART:MOVCX,5LP;MOVDX
7、,280HMOVAL,0FHOUTDX,ALCALLDELAYWord文档.MOVDX,280HMOVAL,0HOUTDX,ALCALLDELAYLOOPLPMOVAH,4CHINT21HDELAYPROCNEARPUSHCXMOVBX,03FFHFOR1:MOVCX,0FFFFHFOR2;LOOPFOR2DECBXJNZFOR1POPCXRETDELAYENDPCODEENDSENDSTART1.利用74LS75设计一个接口电路,使8个LED循环点亮,中间间隔1秒,共循环3次Word文档.CODESEGMENT
8、ASSUMECS:CODESTART:MOVCX,3MOVSI,8LP1:MOVDX,280HMOVAL,01HLP2:OUTDX,ALCALLDELAYSHLAL,1DECSIJNZLP2LOOPLP1MOVAH,4CHINT21HDELAYPROCNEARPUSHCXMOVBX,03FFHFOR1:MOVCX,0FFFFHFOR2;LOOPFOR2DECBXJNZFO