收藏 分享(赏)

安工大 微机原理,接口技术实验报告 纪平.doc

上传人:dzzj200808 文档编号:4067468 上传时间:2018-12-06 格式:DOC 页数:23 大小:158.50KB
下载 相关 举报
安工大 微机原理,接口技术实验报告 纪平.doc_第1页
第1页 / 共23页
安工大 微机原理,接口技术实验报告 纪平.doc_第2页
第2页 / 共23页
安工大 微机原理,接口技术实验报告 纪平.doc_第3页
第3页 / 共23页
安工大 微机原理,接口技术实验报告 纪平.doc_第4页
第4页 / 共23页
安工大 微机原理,接口技术实验报告 纪平.doc_第5页
第5页 / 共23页
点击查看更多>>
资源描述

1、微机原理与接口技术实验报告安徽工业大学计算机学院实验一 存贮器读写实验一、实验目的:l、熟悉静态 RAM 的使用方法 ,掌握 8088 微机系统扩展 RAM 的方法。2、掌握静态 RAM 读写数据编程方法。二、实验内容对指定地址区间的 RAM(2000H23FFH)先进行写数据 55AAH,然后将其内容读1出再写到 3000H33FFH 中。三、硬件电路(系统中已连接好)四、程序清单:CODE SEGMENT ;RAM.ASMASSUME CS:CODEPA EQU 0FF20H ;字位口PB EQU 0FF21H ;字形口PC EQU 0FF22H ;键入口ORG 1850hSTART: J

2、MP START0BUF DB ?,?,?,?,?,?data1: db0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,80h,90h,88h,83h,0c6h,0a1hdb 86h,8eh,0ffh,0ch,89h,0deh,0c7h,8ch,0f3h,0bfh,8FHSTART0: MOV AX,0HMOV DS,AXMOV BX,4000HMOV AX,55AAHMOV CX,0200HRAMW1: MOV DS:BX,AXADD BX,0002HLOOP RAMW1MOV AX,4000HMOV SI,AXMOV AX,5000HMOV DI,AXMOV CX

3、,0400HCLDREP MOVSBcall buf1mov cx,0ffhcon1: push cxcall disppop cxloop con1call buf2con2: call disp2jmp con2DISP: MOV AL,0FFH ;00HMOV DX,PAOUT DX,ALMOV CL,0DFH ;20H ;显示子程序 ,5msMOV BX,OFFSET BUFDIS1: MOV AL,BXMOV AH,00HPUSH BXMOV BX,OFFSET DATA1ADD BX,AXMOV AL,BXPOP BXMOV DX,PBOUT DX,ALMOV AL,CLMOV D

4、X,PAOUT DX,ALPUSH CXDIS2: MOV CX,00A0HLOOP $POP CXCMP CL,0FEH ;01HJZ LX1INC BXROR CL,1 ;SHR CL,1JMP DIS1LX1: MOV AL,0FFHMOV DX,PBOUT DX,ALRETBUF1: MOV BUF,06HMOV BUF+1,02HMOV BUF+2,02HMOV BUF+3,05HMOV BUF+4,06HMOV BUF+5,17HRET3BUF2: MOV BUF,17HMOV BUF+1,17HMOV BUF+2,09HMOV BUF+3,00HMOV BUF+4,00HMOV

5、BUF+5,0dHRETCODE ENDSEND START实验二 8259 单级中断控制器实验一、实验目的1. 掌握 8259 中断控制器的接口方法。2. 掌握 8259 中断控制器的应用编程。二、实验内容l. 硬件线路原理图如图 514图 512. 硬件线路连接 8259 的 INT 连 Xl5(8088 的 INTR) 8259 的 INTA 连 Xl2(8088INTA) “ ”插孔和 8259 的 3 号中断 IR3 插孔相连, “ ”端初始为低电平。 8259 的 CS 端接 X22思考题:若用 IR5 产生中断,要求修改硬件和软件并调试成功。三、程序清单CODE SEGMENT

6、;ASSUME CS:CODEINTPORT1 EQU 0FF80HINTPORT2 EQU 0FF81HINTQ5 EQU INTREEUP5 INTQ7 EQU INTREEUP7PA EQU 0FF20H ;字位口PB EQU 0FF21H ;字形口PC EQU 0FF22H ;键入口ORG 12D0HSTART: JMP START0BUF DB ?,?,?,?,?,?intcnt db ?data1: db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,80h,90h,88h,83h,0c6h,0a1hdb 86h,8eh,0ffh,0ch,89h,0de

7、h,0c7h,8ch,0f3h,0bfh,8FHSTART0: CLDCALL BUF1CALL WRINTVER ;WRITE INTRRUPTMOV AL,13HMOV DX,INTPORT1OUT DX,AL5MOV AL,08HMOV DX,INTPORT2OUT DX,ALMOV AL,09HOUT DX,ALMOV AL,0F7HOUT DX,ALMOV intcnt,01H ;TIME=1STIWATING: CALL DISP ;DISP 8259-1JMP WATINGWRINTVER: MOV AX,0HMOV ES,AXMOV DI,002CHLEA AX,INTQ5 S

8、TOSWMOV AX,0000hSTOSWMOV DI,003CHLEA AX,INTQ7STOSWMOV AX,0000hSTOSWRETINTREEUP5: CLIpush axpush bxpush cxpush dxMOV AL,INTCNTCALL CONVERSMOV BX,OFFSET BUF ;077BHMOV AL,10HMOV CX,05HINTRE0: MOV BX,ALINC BXLOOP INTRE0MOV AL,20H6MOV DX,INTPORT1OUT DX,ALADD INTCNT,01HCMP INTCNT,06HJNA INTRE2CALL BUF2 ;D

9、ISP:goodINTRE1: CALL DISPJMP INTRE1CONVERS: AND AL,0FHMOV BX,offset buf ;077AHMOV BX+5,ALRETINTRE2: MOV AL,20HMOV DX,INTPORT1OUT DX,ALpop dxpop cxpop bxpop axSTIIRETINTREEUP7: CLIMOV AL,20HMOV DX,INTPORT1OUT DX,ALcall buf3 ;disp:errINTRE3: CALL DISPJMP INTRE3 DISP: MOV AL,0FFH ;00HMOV DX,PAOUT DX,AL

10、MOV CL,0DFH ;20H ;显示子程序 ,5msMOV BX,OFFSET BUFDIS1: MOV AL,BXMOV AH,00HPUSH BXMOV BX,OFFSET DATA1ADD BX,AX7MOV AL,BXPOP BXMOV DX,PBOUT DX,ALMOV AL,CLMOV DX,PAOUT DX,ALPUSH CXDIS2: MOV CX,00A0HLOOP $POP CXCMP CL,0FEH ;01HJZ LX1INC BXROR CL,1 ;SHR CL,1JMP DIS1LX1: MOV AL,0FFHMOV DX,PBOUT DX,ALRETBUF1:

11、MOV BUF,08HMOV BUF+1,02HMOV BUF+2,05HMOV BUF+3,09HMOV BUF+4,17HMOV BUF+5,01HRETBUF2: MOV BUF,09HMOV BUF+1,00HMOV BUF+2,00HMOV BUF+3,0dHMOV BUF+4,10HMOV BUF+5,10HRETBUF3: MOV BUF,0eHMOV BUF+1,18HMOV BUF+2,18HMOV BUF+3,10H8MOV BUF+4,10HMOV BUF+5,10HRETCODE ENDSEND START9实验三 8255A 并行口实验一、实验目的1. 掌握 8255

12、A 和微机接口方法。2. 掌握 8255A 的工作方式和编程原理。3. 掌握通过 8255A 并行口传输数据的方法 , 以控制发光二极管的亮与灭。二、实验内容用 8255做输出口,控制十二个发光管亮灭,模拟交通灯管理。硬件原理图如图52思考题:如果通过 8255A控制发光二极管,PB4-PB7 对应红灯, PC0-PC3对应绿灯, PC4-PC7对应黄灯, 以模拟交通路灯的管理,将如何实现。程序清单:CODE SEGMENT ;H8255-2.ASMASSUME CS:CODEIOCONPT EQU 0FF2BHIOAPT EQU 0FF28HIOBPT EQU 0FF29HIOCPT EQU

13、 0FF2AHORG 11e0HSTART: MOV AL,82HMOV DX,IOCONPTOUT DX,ALMOV DX,IOBPT10IN AL,DXMOV BYTE PTR DS:0601H,ALMOV DX,IOCONPTMOV AL,80HOUT DX,ALMOV DX,IOBPTMOV AL,DS:0601HOR AL,0F0HOUT DX,ALMOV DX,IOCPTMOV AL,0FFHOUT DX,ALMOV DX,IOBPTMOV AL,00FHOUT DX,ALCALL DELAY1IOLED0: MOV AL,01011111BMOV DX,IOBPTOUT DX,A

14、LMOV AL,11111010BMOV DX,IOCPTOUT DX,ALCALL DELAY1CALL DELAY1OR AL,0FFHOUT DX,ALMOV CX,8HIOLED1: MOV DX,IOCPTMOV AL,DS:0601HAND AL,10101111BOUT DX,ALCALL DELAY2OR AL,01011111BOUT DX,ALCALL DELAY2LOOP IOLED1MOV DX,IOBPTMOV AL,00FH11OUT DX,ALCALL DELAY2MOV AL,10101111BMOV DX,IOBPTOUT DX,ALMOV AL,111101

15、01BMOV DX,IOCPTOUT DX,ALCALL DELAY1CALL DELAY1OR AL,0FFHOUT DX,ALMOV CX,8HIOLED2: MOV DX,IOCPTMOV AL,DS:0601HAND AL,01011111BOUT DX,ALCALL DELAY2OR AL,10100000BOUT DX,ALCALL DELAY2LOOP IOLED2MOV DX,IOCPTMOV AL,0F0HOUT DX,ALCALL DELAY2JMP IOLED0DELAY1: PUSH AXPUSH CXMOV CX,0030HDELY2: CALL DELAY2LOOP

16、 DELY2POP CXPOP AX RETDELAY2: PUSH CXMOV CX,8000HDELA1: LOOP DELA112POP CXRETCODE ENDSEND START实验四 8250 串口实验一、实验目的(1)系统扩展以 8250 为核心的可编程串行异步通讯接口芯片。(2)对扩展的串行通讯接口实现自发自收。二、实验内容将寄存器 AH 的内容从 10H 开始通过 8250 发送、接收,每次收发后 AH 的内容自动增 1 直到 FFH 为止,再将每次接收到的数据,依次写到内存 3000H30EFH 单元中,实现自发自收。三、实验接线图 思考题如果使用通讯协议:1 个起始位,

17、7 位数据位,2 个停止位,波特率:9600。系统将如何实现。13程序清单:CODE SEGMENT ;H8250.ASMASSUME CS: CODE ;H8250.ASMDATAEQU 0ff80H ;BTS-LSBMSB EQU 0ff81HLINE EQU 0ff83HLSTAT EQU 0ff85HPA EQU 0FF20H ;字位口PB EQU 0FF21H ;字形口PC EQU 0FF22H ;键入口ORG 29A0HSTART: JMP START0BUF DB ?,?,?,?,?,?data1:db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,8

18、0h,90h,88h,83h,0c6h,0a1hdb 86h,8eh,0ffh,0ch,89h,0deh,0c7h,8ch,0f3h,0bfh,8FHSTART0: MOV AL,80H ;DLAB=1MOV DX,LINEOUT DX,ALMOV AL,0CH ;BTS=4800MOV DX,DATA ;ff80HOUT DX,ALMOV DX,MSBMOV AL,00OUT DX,ALMOV AL,03HSUB AL 01H ;8- BIT ,1-STOPMOV DX,LINEOUT DX,ALMOV AL,00 ;NO-INTMOV DX,MSB ;8001HOUT DX,ALMOV A

19、H,10HMOV BX,4000HMAIN: CALL TXDCALL RCVMOV BX,AL14INC BXINC AHCMP AH,00HJNZ MAINCALL BUF1MOV CX,00FFHS3: PUSH CXCALL DISPPOP CXLOOP S3CALL BUF3S1: CALL DISPJMP S1TXD: MOV DX,LSTATWAIT1: IN AL,DXTEST AL,20HJZ WAIT1MOV AL,AHMOV DX,DATAOUT DX,ALRETRCV: MOV DX,LSTATWAIT2: IN AL,DXTEST AL,01HJZ WAIT2TEST

20、 AL,0EHJNZ ERRMOV DX,DATAIN AL,DXRETERR: CALL BUF2S2: CALL DISPJMP S2;-DISP: MOV AL,0FFH ;00HMOV DX,PAOUT DX,ALMOV CL,0DFH ;20H ;显示子程序 ,5ms15MOV BX,OFFSET BUFDIS1: MOV AL,BXMOV AH,00HPUSH BXMOV BX,OFFSET DATA1ADD BX,AXMOV AL,BXPOP BXMOV DX,PBOUT DX,ALMOV AL,CLMOV DX,PAOUT DX,ALPUSH CXDIS2: MOV CX,00

21、A0HDELAY: LOOP DELAYPOP CXCMP CL,0FEH ;01HJZ LX1INC BXROR CL,1 ;SHR CL,1JMP DIS1LX1: MOV AL,0FFHMOV DX,PBOUT DX,ALRETBUF1: MOV BUF,08HMOV BUF+1,02HMOV BUF+2,05HMOV BUF+3,00HMOV BUF+4,17HMOV BUF+5,17HRET;-BUF2: MOV BUF,08HMOV BUF+1,02HMOV BUF+2,05HMOV BUF+3,00H16MOV BUF+4,0EHMOV BUF+5,18HRETBUF3: MOV

22、 BUF,09HMOV BUF+1,00HMOV BUF+2,00HMOV BUF+3,0DHMOV BUF+4,10HMOV BUF+5,10HRETCODE ENDSEND START实验五 A/D 转换实验一、实验目的 了解模/数转换基本原理,掌握 ADC0809的使用方法; 二、实验内容 1、A/D 转换实验 利用实验系统上电位器提供的可调电压作为 0809模拟信号的输入,编制程序,将模拟量转换为数字量,通过数码管显示出来。实验步骤 将 0809 CS4插孔连到译码输出 FF80H插孔。 将通道 0模拟量输入端 IN0连电位器 W1的中心插头 AOUT1(05V)插孔,8MHZT。 运

23、行实验程序,系统上显示“0809 XX”。“XX”表示输入模拟量转换后的数字量。 调节电位器 Wl, 显示器上会不断显示新的转换结果。模拟量和数字量对应关系的典型值为:0V00H +2.5V80H +5VFFH 按 RST键退出。2、数据采集实验17(1)实验接线图18(2)实验程序清单CODE SEGMENT ;ASSUME CS:CODEINTPORT1 EQU 0FF80HINTPORT2 EQU 0FF81HINTQ3 EQU INTREEUP3TCONTR0 EQU 0043HTCON1 EQU 0041HIOCONPT EQU 0FF2BHIOBPT EQU 0FF29HIOAPT

24、 EQU 0FF28HPA EQU 0FF20H ;字位口PB EQU 0FF21H ;字形口PC EQU 0FF22H ;键入口ADPORT EQU 0FE00HORG 12D0HSTART: JMP START0BUF DB ?,?,?,?,?,?intcnt db ?19RES DB ?data1 db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,80h,90h,88h,83h,0c6h db 0a1h,86h,8eh,0ffh,0ch,89h,0deh,0c7h,8ch,0f3h,0bfh,8FHSTART0: CLDCALL BUF1CALL WRINT

25、VER MOV AL,13HMOV DX,INTPORT1OUT DX,ALMOV AL,08HMOV DX,INTPORT2OUT DX,ALMOV AL,09HOUT DX,ALMOV AL,0F7HOUT DX,ALMOV intcnt,25 MOV DX,TCONTR0MOV AL,74HOUT DX,ALMOV DX,TCON1 MOV AX,40000OUT DX,ALMOV AL,AHOUT DX,ALMOV DX,0FF2BHMOV AL,82HOUT DX,ALSTIWATING: CALL DISP JMP WATINGWRINTVER: MOV AX,0HMOV ES,A

26、XMOV DI,002CHLEA AX,INTQ3STOSWMOV AX,0000hSTOSW20RETINTREEUP3: DEC INTCNTJNZ INTRE2MOV INTCNT, 25ADCON: MOV AX,00MOV DX,ADPORTOUT DX,ALMOV CX,0500HDELAY: LOOP DELAYMOV DX,ADPORTIN AL,DXMOV RES,ALCALL CONVERSMOV AL,RESCMP AL, 66HJA NEXT1MOV AL, 0F0HMOV DX, IOAPTOUT DX,ALJMP INTRE2NEXT1: CMP AL, 99HJA

27、 NEXT2MOV AL, 0C3HMOV DX, IOAPTOUT DX,ALJMP INTRE2NEXT2: MOV AL, 0FHMOV DX, IOAPTOUT DX,ALINTRE2: MOV AL,20HMOV DX,INTPORT1OUT DX,ALIRETCONVERS: MOV AH, ALAND AL, 0FHMOV BX, OFFSET BUFMOV BX+5, ALMOV AL,AH21AND AL, 0F0HMOV CL, 04HSHR AL, CLMOV BX+4, ALRETDISP: MOV AL, 0FFH MOV DX, PAOUT DX, ALMOV CL

28、, 0DFH MOV BX, OFFSET BUFDIS1: MOV DX, PCOUT DX, ALMOV AL, BXMOV AH, 00HPUSH BXMOV BX, OFFSET DATA1ADD BX, AXMOV AL, BXPOP BXMOV DX, PBOUT DX, ALMOV AL, CLMOV DX, PAOUT DX, ALPUSH CXDIS2: MOV CX, 00A0HLOOP $POP CXCMP CL,0FEH JZ LX1INC BXROR CL, 1 JMP DIS1LX1: MOV AL, 0FFHMOV DX, PBOUT DX, ALRETBUF1:

29、 MOV BUF, 00H22MOV BUF+1, 08HMOV BUF+2, 00HMOV BUF+3 ,09HMOV BUF+4, 00HMOV BUF+5, 00HRETCODE ENDSEND START实验体会与感悟:在这些日子里,通过微机原理课实验,学到很多东西,不仅巩固了以前所学过的知识,而且学到了很多在书本上所没有学到过的知识。以前对于编程工具的使用还处于一知半解的状态上,但是经过一段上机的实践,程序的正确性上都有了很大程度的提高。实验使我我懂得了理论联系实践是很重要的,只有把所学的理论知识与实践相结合起来,从而提高自己的实际动手能力和独立思考的能力。在实验的过程中遇到问题,可

30、以说得是困难重重,难免会遇到过各种各样的问题,同时在设计的过程中发现了自己的不足之处,对以前所学过的知识理解得不够深刻,掌握得不够牢固。English is the most widely spoken language in the history of our planet, used in some way by at least one out of every seven human beings around the globe. Half of the worlds books are written in English, and the majority of interna

31、tional telephone calls are made in English. English is the language of over sixty percent of the worlds radio programs. More than seventy percent of international mail is written and addressed in English, and eighty percent of all computer text is stored in English. English has acquired the largest

32、vocabulary of all the worlds languages, perhaps as many as two million words, and has generated one of the noblest bodies of literature in the annals of the human it is now time to face the fact that English is a crazy language - the most lunatic and loopy and of all languages. In the crazy English

33、language, the blackbird hen is brown, blackboards can be green or blue, and blackberries are green and then red before they are ripe. Even if blackberries were really black and blueberries really blue, what are strawberries, cranberries, huckleberries, raspberries, and gooseberries supposed to look

34、add to this insanity there is no butter in buttermilk, no egg in eggplant, no grape in grapefruit, no bread in shortbread, neither worms nor wood in wormwood, neither mush nor room in mushroom, neither pine nor apple in pineapple, neither peas nor nuts in peanuts, and no ham in a hamburger. (In fact

35、, if somebody invented a sandwich consisting of a ham patty in a bun, we would have a hard time finding a name for it.)To make matters worse, English muffins werent invented in England, fries in France, or Danish pastries in Denmark. And we discover even more culinary madness in the that sweetmeat i

36、s made from fruit, while sweetbread, which isnt sweet, is made from this unreliable English tongue, greyhounds arent always grey (or gray); panda bears and koala bears arent bears (theyre marsupials); a woodchuck is a groundhog, which is not a hog; a horned toad is a lizard; glowworms are fireflies,

37、 but fireflies are not flies (theyre beetles); ladybugs and lightning bugs are also beetles (and to, a significant proportion of ladybugs must be male); a guinea pig is neither a pig nor from Guinea (its a South American rodent); and a titmouse is neither is like the air we breathe. Its invisible, i

38、nescapable, indispensable, and we take it for granted. But, when we take the time to step back and listen to the sounds that escape from the holes in peoples faces and to ex- the paradoxes and vagaries of English, we find that hot dogs can be cold, darkrooms can be lit, homework can be done in schoo

39、l, nightmares can take place in broad daylight while morning sickness and daydreaming can take place at night, tomboys are girls and midwives can be men, hours - especially happy hours and rush hours - often last longer than sixty minutes, quick- sand works very slowly, boxing rings are square, silv

40、erware and glasses can be made of plastic and tablecloths of paper, most are dialed by being punched (or pushed?), and most bathrooms dont have any baths in them. In fact, a dog can go to the bathroom under a tree - no bath, no room; its still going to the bathroom. And doesnt it seem a little bizar

41、re that we go to the bathroom in order to go to the is it that a woman can man a station but as man cant woman one, that a man can father a movement but a woman cant mother one, and that a king rules a kingdom but a queen doesnt rule a? How did all those Renaissance men reproduce when there dont see

42、m to have been any Renaissance writer is someone who writes, and a stinger is something that stings. But fingers dont grocers dont, haberdashers dont, hammers dont ham, and humdingers dont the plural of tooth is teeth , shouldnt the plural of booth be ? One goose, two geese - so one moose, two One i

43、ndex, two indices - one Kleenex, two If people ring a bell today and rang a bell yesterday, why dont we say that they a ball? If they wrote a letter, perhaps they also their tongue. If the teacher taught, why isnt it also true that the preacher? Why is it that the sun shone yesterday while I shined

44、my shoes, that I treaded water and then trod on the beach, and that I flew out to see a World Series game in which my favorite player flied we conceive a conception and receive at a reception, why dont we grieve a and believe a? If a horsehair mat is made from the hair of horses and a camels hair br

45、ush from the hair of camels, from what is a mohair coat made? If adults commit adultery, do infants commit infantry? If olive oil is made from olives, what do they make baby oil from? If a vegetarian eats vegetables, what does a humanitarian eat? (And Im beginning to worry about those authoritarians

46、.)And if pro and con are opposites, is congress the opposite of you have to believe that all English speakers should be committed to an asylum for the verbally insane. In what other language do people drive in a parkway and park in a driveway? In what other language do people recite at a play and pl

47、ay at a recital? In what other language do privates eat in the general mess and generals eat in the private mess? In what other language do people ship by truck and send cargo by ship? In what other language can your nose run and your feet can a slim chance and a fat chance be the same and a bad lic

48、king and a good licking be the same, while a wise man and a wise guy are opposites? How can sharp speech and blunt speech be the same and quite a lot and quite a few the same, while overlook and oversee are opposites? How can the weather be hot as hell one day and cold as hell the next? How can the expressions “Whats going on?“ and “Whats coming off?“ mean exactly the samton and unbutton and tie and untie are opposites, why

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 中等教育 > 中学实验

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报