资源描述:
《微机原理实验报告一.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验报告一、实验目的1.熟悉80C51单片微机汇编语言设计及编程技巧。2.掌握逻辑运算程序的设计方法。3.掌握求最小数和最大数程序的设计方法。4.掌握多字节无符号十进制数加、减法程序的设计二、实验器材1.Micetek仿真器一台2.实验板一块三、实验内容1.逻辑运算:根据下列逻辑运算式,编写程序计算运算结果。Y=A⊕B•C•D+A设:A=63H,B=82H,C=C5H,D=36H。求Y=?2.求最小数和最大数:10个无符号数连续存放在以20H为起始地址的RAM中,找出其中的最小值存入30H单元中,找出其中的最大值存入31H单元中。3.十进制加、减运
2、算:286729+652430-752196=?在8051片内RAM的20H~22H中放入3字节被加数(低位在先)、23H~25H放入加数(低位在先)、26H~28H放入减数,结果存入2DH~2FH单元(低位在先)。四、实验数据记录和分析1.逻辑运算:A.实验程序:ORG0000HAJMPfxORG0080Hfx:MOVA,#63HMOVR0,#36HORLA,R0CPLAMOVR1,AMOVA,#82HMOVR0,#0C5HANLA,R0CPLAMOVR0,#63HXRLA,R0CPLAANLA,R1EndB.程序list文件符号值类型AC=00
3、D6HCONST常量ACC=00E0HCONST常量B=00F0HCONST常量CY=00D7HCONST常量DPH=0083HCONST常量DPL=0082HCONST常量EA=00AFHCONST常量ES=00ACHCONST常量ET0=00A9HCONST常量ET1=00ABHCONST常量EX0=00A8HCONST常量EX1=00AAHCONST常量F0=00D5HCONST常量F1=00D1HCONST常量FX=0080HCODE标号IE=00A8HCONST常量IE0=0089HCONST常量IE1=008BHCONST常量IP=00
4、B8HCONST常量IT0=0088HCONST常量IT1=008AHCONST常量OV=00D2HCONST常量P=00D0HCONST常量P0=0080HCONST常量P1=0090HCONST常量P2=00A0HCONST常量P3=00B0HCONST常量PCON=0087HCONST常量PS=00BCHCONST常量PSW=00D0HCONST常量PT0=00B9HCONST常量PT1=00BBHCONST常量PX0=00B8HCONST常量PX1=00BAHCONST常量RB8=009AHCONST常量REN=009CHCONST常量RI
5、=0098HCONST常量RS0=00D3HCONST常量RS1=00D4HCONST常量SBUF=0099HCONST常量SCON=0098HCONST常量SM0=009FHCONST常量SM1=009EHCONST常量SM2=009DHCONST常量SP=0081HCONST常量TB8=009BHCONST常量TCON=0088HCONST常量TF0=008DHCONST常量TF1=008FHCONST常量TH0=008CHCONST常量TH1=008DHCONST常量TI=0099HCONST常量TL0=008AHCONST常量TL1=008
6、BHCONST常量TMOD=0089HCONST常量TR0=008CHCONST常量TR1=008EHCONST常量公有符号:57私有符号:0C.实验思路:1.将A值给累加器2.将D值给R03.将A和D逻辑或,并把结果存入累加器A4.A和D或以后取非5.将A和D取非以后的结果存到R1中6.将B值给累加器A7.将C值给R08.B与C逻辑与9.取反10.将A值存到R0中11.最后将逻辑运算前后的两个逻辑与2.求最小数和最大数:A.实验程序:ORG0000HAJMPMAINORG0080HMAIN:MOVR0,#20HMOVA,@R0MOVR7,#09H
7、MOVR2,AMOVR3,ALOOP:INCR0ACALLCOMPDJNZR7,LOOPAJMPDONECOMP:CLRCMOVA,@R0SUBBA,R2JCMINMOVA,@R0MOVR1,AMOVA,R3SUBBA,R1JCMAXRETMIN:MOVA,@R0MOVR2,ARETMAX:MOVA,R1MOVR3,ARETDONE:MOV30H,R2MOV31H,R3ENDB.实验生成list文件:符号值类型AC=00D6HCONST常量ACC=00E0HCONST常量B=00F0HCONST常量COMP=008EHCODE标号CY=00D7HC
8、ONST常量DONE=00A0HCODE标号DPH=0083HCONST常量DPL=0082HCONST常量EA=00AF