8088系列十六位微机实验指导书.docx
- 文档编号:3325017
- 上传时间:2022-11-21
- 格式:DOCX
- 页数:24
- 大小:18.31KB
8088系列十六位微机实验指导书.docx
《8088系列十六位微机实验指导书.docx》由会员分享,可在线阅读,更多相关《8088系列十六位微机实验指导书.docx(24页珍藏版)》请在冰豆网上搜索。
8088系列十六位微机实验指导书
;《8088系列十六位微机实验指导书》
;========================软件实验程序清单==============================
;----------------------实验一清零程序---------------------------
CODESEGMENT
ASSUMECS:
CODE,DS:
CODE,ES:
CODE
ORG3000H
start0:
MOVBX,4000H
MOVAX,0000H
MOVCX,007FH
L1:
MOV[BX],AX
INCBX
INCBX
LOOPL1
JMP$
;---------------------实验二拆字程序-----------------------------
ORG3020H
MOVBX,4000H
MOVAL,[BX]
MOVAH,AL
MOVCL,4
SHRAH,CL
INCBX
MOV[BX],AH
ANDAL,0FH
INCBX
MOV[BX],AL
JMP$
;----------------------------实验三拼字程序------------------------------
ORG3040H
MOVBX,4000H
MOVAX,[BX]
ANDAL,0FH
MOVCL,4
SHLAL,CL
ANDAH,0FH
ORAL,AH
ADDBX,2
MOV[BX],AL
JMP$
;--------------------------实验四数据区移动---------------------------
ORG3060H
MOVCX,0010H
MOVSI,4100H
MOVDI,4200H
CMPSI,DI
JAA42
ADDSI,CX
ADDDI,CX
A41:
DECSI
DECDI
MOVAL,[SI]
MOV[DI],AL
LOOPA41
JMP$
A42:
MOVAL,[SI]
MOV[DI],AL
INCSI
INCDI
LOOPA42
JMP$
;---------------------------实验五数据排序实验--------------------
ORG3090H
MOVCX,000AH
A53:
MOVBX,4000H
PUSHCX
A52:
MOVAX,[BX]
CMPAL,AH
JCA51
A54:
INCBX
LOOPA52
POPCX
LOOPA53
JMP$
A51:
XCHGAL,AH
MOV[BX],AX
JMPA54
;-------------------------实验六找"零"个数-------------------
ORG30B0H
MOVBX,4100H;COUNT
MOVAX,0000
MOV[BX],AX
MOVCX,0010H
MOVDI,4000H
CLD
A62:
SCASB
JZA61
A63:
LOOPA62
JMP$
A61:
INCBYTEPTR[BX]
JMPA63
;------------------------实验七32位二进制乘法-------------------
ORG30D0H
JMPSTART
N1DW?
N2DW?
N3DW?
N4DW?
M1DW0
M2DW0
M3DW0
M4DW0
START:
MOVAX,N2
MULN4
MOVM4,AX
MOVM3,DX
MOVAX,N4
MULN1
ADDM3,AX
ADCM2,DX
MOVAX,N3
MULN2
ADDM3,AX
ADCM2,DX
ADCM1,0
MOVAX,N3
MULN1
ADDM2,AX
ADCM1,DX
JMP$
;------------------------实验八多分支程序设计----------------------
ORG3130H
JMPA81
TABDWLED0,LED1,LED2,LED3,LED4,LED5,LED6,LED7
DWLED8,LED9,LEDA,LEDB,LEDC,LEDD,LEDE,LEDF
A81:
MOVBX,OFFSETTAB
MOVSI,4000H
MOVAL,[SI]
ANDAL,0FH
SHLAL,1
MOVAH,00H
ADDBX,AX
JMP[BX]
LED0:
MOVAL,0C0H
JMPLEDX
LED1:
MOVAL,0F9H
JMPLEDX
LED2:
MOVAL,0A4H
JMPLEDX
LED3:
MOVAL,0B0H
JMPLEDX
LED4:
MOVAL,99H
JMPLEDX
LED5:
MOVAL,92H
JMPLEDX
LED6:
MOVAL,82H
JMPLEDX
LED7:
MOVAL,0F8H
JMPLEDX
LED8:
MOVAL,80H
JMPLEDX
LED9:
MOVAL,90H
JMPLEDX
LEDA:
MOVAL,88H
JMPLEDX
LEDB:
MOVAL,83H
JMPLEDX
LEDC:
MOVAL,0C6H
JMPLEDX
LEDD:
MOVAL,0A1H
JMPLEDX
LEDE:
MOVAL,86H
JMPLEDX
LEDF:
MOVAL,8EH
JMPLEDX
LEDX:
MOVDX,0FFDCH
OUTDX,AL
MOVCL,20H
MOVDX,0FFDDH
LEDX1:
MOVAL,CL
OUTDX,AL
PUSHCX
CALLDLL
POPCX
RORCL,1
JMPLEDX1
DLL:
MOVBX,0020H
DL1:
DECBX
CMPBX,0000
JZDL3
MOVCX,04FFH
LOOP$
JMPDL1
DL3:
RET
;-------------------------实验九显示子程序----------------------------
ORG31E0H
JMPSTART9
ZXKEQU0FFDCH
ZWKEQU0FFDDH
LEDDB0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H
DB88H,83H,0C6H,0A1H,86H,8EH,0FFH,0CH,0DEH,0F3H
BUFDB?
?
?
?
?
?
START9:
MOVCX,0005H;"dais88"ON/OFFLED,COUNT
A90:
PUSHCX
A91:
MOVBX,OFFSETBUF
MOVAX,0A0DH
MOV[BX],AX
ADDBX,2
MOVAX,0501H
MOV[BX],AX
ADDBX,2
MOVAX,0808H
MOV[BX],AX
MOVCX,0050H;ONLED,TIME
A92:
PUSHCX
CALLDIS
POPCX
LOOPA92
MOVCX,0003H
MOVAX,1010H
MOVBX,OFFSETBUF
A93:
MOV[BX],AX
INCBX
INCBX
LOOPA93
MOVCX,0020H;OFFSET,TIME
A94:
PUSHCX
CALLDIS
POPCX
LOOPA94
POPCX
LOOPA90
;-------------------
MOVCX,0005H;"good"ON/OFFLED-COUNT
A99:
PUSHCX
A95:
MOVBX,OFFSETBUF
MOVAX,0009H
MOV[BX],AX
ADDBX,2
MOVAX,0D00H
MOV[BX],AX
ADDBX,2
MOVAX,1010H
MOV[BX],AX
MOVCX,0050H;ONLED-TIME
A96:
PUSHCX
CALLDIS
POPCX
LOOPA96
MOVCX,0003H
MOVAX,1010H
MOVBX,OFFSETBUF
A97:
MOV[BX],AX
INCBX
INCBX
LOOPA97
MOVCX,0020H;OFFSET-TIME
A98:
PUSHCX
CALLDIS
POPCX
LOOPA98
POPCX
LOOPA99
JMPSTART9
;--------------------------
DIS:
MOVCL,20H
MOVBX,OFFSETBUF
DIS1:
MOVAL,[BX]
PUSHBX
MOVBX,OFFSETLED
XLAT
POPBX
MOVDX,ZXK
OUTDX,AL
MOVAL,CL
MOVDX,ZWK
OUTDX,AL
PUSHCX
MOVCX,0100H
DELAY:
LOOP$
POPCX
CMPCL,01H
JZEXIT
INCBX
SHRCL,1
JMPDIS1
EXIT:
MOVAL,00H
MOVDX,ZWK
OUTDX,AL
RET
;=======================硬件实验程序清单========================
;--------------------实验一8255A并行口实验
(1)方波-----------------
ORG32C0H
JMPSTARTP1
PAEQU0FFD8H
PBEQU0FFD9H
PCEQU0FFDAH
PCTLEQU0FFDBH
STARTP1:
MOVDX,PCTL
MOVAL,80H
OUTDX,AL
MOVAL,55H
P11:
MOVDX,PA
OUTDX,AL
INCDX
OUTDX,AL
INCDX
OUTDX,AL
MOVCX,0800H
LOOP$
NOTAL
JMPP11
;-----------------实验二8255A并行口实验
(2)PA输入,PB输出-------------
ORG32E0H
MOVDX,PCTL
MOVAL,90H
OUTDX,AL
P2:
MOVDX,PA
INAL,DX
INCDX
OUTDX,AL
JMPP2
;------------------实验三8255A并行口实验(3)控制交通灯----------------
ORG32F0H
STARTP3:
MOVAL,88H
MOVDX,PCTL
OUTDX,AL;MOD:
0,
MOVDX,PA
MOVAL,0B6H
OUTDX,AL
INCDX
MOVAL,0DH
OUTDX,AL
CALLDELAY1
P30:
MOVAL,75H
MOVDX,PA
OUTDX,AL
INCDX
MOVAL,0DH
OUTDX,AL
CALLDELAY1
CALLDELAY1
MOVCX,08H
P31:
MOVDX,PA
MOVAL,0F3H
OUTDX,AL
INCDX
MOVAL,0CH
OUTDX,AL
CALLDELAY2
MOVDX,PA
MOVAL,0F7H
OUTDX,AL
INCDX
MOVAL,0DH
OUTDX,AL
CALLDELAY2
LOOPP31
MOVDX,PA
MOVAL,0AEH
OUTDX,AL
INCDX
MOVAL,0BH
OUTDX,AL
CALLDELAY1
CALLDELAY1
MOVCX,08H
P32:
MOVDX,PA
MOVAL,9EH
OUTDX,AL
INCDX
MOVAL,07H
OUTDX,AL
CALLDELAY2
MOVDX,PA
MOVAL,0BEH
OUTDX,AL
INCDX
MOVAL,0FH
OUTDX,AL
CALLDELAY2
LOOPP32
JMPP30
DELAY1:
PUSHAX
PUSHCX
MOVCX,0030H
DELY2:
CALLDELAY2
LOOPDELY2
POPCX
POPAX
RET
DELAY2:
PUSHCX
MOVCX,8000H
LOOP$
POPCX
RET
;----------------------实验四简单I/O口扩展------------------
ORG3380H;273,244
PIO1EQU0FFE0H
PIO2EQU0FFE4H
P4:
MOVDX,PIO1
INAL,DX
MOVDX,PIO2
OUTDX,AL
JMPP4
;-----------------------实验五A/D转换实验----------------------
ORG3390H
ADPORTEQU0FFE0H
MOVBUF,00H;DISPLAY080900
MOVBUF+1,08H
MOVBUF+2,00H
MOVBUF+3,09H;DISPLAY080900
MOVBUF+4,00H
MOVBUF+5,00H
P5:
MOVAL,00H;IN0
MOVDX,ADPORT
OUTDX,AL
CALLDIS
MOVDX,ADPORT
INAL,DX
CALLADS
JMPP5
ADS:
MOVAH,AL
ANDAL,0FH
MOVBUF+5,AL
ANDAH,0F0H
MOVCL,4
SHRAH,CL
MOVBUF+4,AH
RET
;--------------------实验六D/A转换实验
(1)方波-----------------
ORG33E0H
DAPORTEQU0FFE0H
MOVAL,0FFH
P6:
MOVDX,DAPORT
OUTDX,AL
MOVCX,0400H
LOOP$
NOTAL
JMPP6
;---------------------实验七D/A转换实验
(2)锯齿波---------------
ORG33F0H
MOVDX,DAPORT
MOVAL,00H
P7:
OUTDX,AL
INCAL
JMPP7
;-------------------实验八8259单级中断控制器实验-------------------
ORG3400H
Port0EQU0FFE0H;0060H
Port1EQU0FFE1H;0061H
P8259:
CLI
CALLWP
MOVAX,OFFSETINT8259
MOVBX,003CH
MOV[BX],AX
MOVBX,003EH
MOVAX,0000H
MOV[BX],AX
CALLFOR8259
movsi,0000h
STI
CON8:
CALLDIS
JMPCON8
INT8259:
CLI
PUSHAX
PUSHBX
PUSHDX
MOVBX,OFFSETBUF
MOVBYTEPTR[BX+SI],07H
INCSI
CMPSI,0007H
JZX59
XX59:
MOVAL,20H
MOVDX,Port0
OUTDX,AL
POPDX
POPBX
POPAX
STI
IRET
X59:
MOVSI,0000H
CALLWP
JMPXX59
FOR8259:
MOVAL,13H
MOVDX,Port0
OUTDX,AL
MOVAL,08H
MOVDX,Port1
OUTDX,AL
MOVAL,09H
OUTDX,AL
MOVAL,7FH;IRQ7
OUTDX,AL
RET
WP:
MOVBUF,11H
MOVBUF+1,10H
MOVBUF+2,10H
MOVBUF+3,10H
MOVBUF+4,10H
MOVBUF+5,10H
RET
;-----------------------实验九定时/计数器8253方波-------------------
org3490h
MOVDX,0FFE3H
MOVAL,36H
OUTDX,AL
MOVDX,0FFE0H
MOVAL,00H
OUTDX,AL
MOVAL,10H
OUTDX,AL
JMP$
;----------------------------实验十继电器控制------------------------
ORG34B0H
MOVDX,0FFDBH;8255CTL?
J0:
MOVAL,00H
OUTDX,AL;PC0=0
CALLJDL
MOVAL,01H
OUTDX,AL;PC0=1
CALLJDL
JMPJ0
JDL:
MOVCX,0004H
JDL1:
PUSHCX
MOVCX,0FFFFH
LOOP$
POPCX
LOOPJDL1
RET
;----------------实验十二8251串口实验
(2)8251发送26个字母-----------------
ORG34E0H
JMPS8251
Z8251EQU0FFE1H
D8251EQU0FFE0H
COM_MODEQU04EH
COM_COMEQU25H
TXBUFDB26DUP(?
)
;------------------------
S8251:
MOVDX,Z8251
MOVAL,COM_MOD
OUTDX,AL;8bit,*16
MOVAL,COM_COM;
OUTDX,AL
MOVBX,OFFSETTXBUF
MOVAL,41H;'A'
L11:
MOV[BX],AL
INCBX
INCAL
CMPAL,5BH
JNZL11
;-------------------------
L3:
MOVBX,OFFSETTXBUF
MOVCX,001AH
L2:
MOVAH,[BX]
CALLSEND
;INCBYTEPTR[BX]
INCBX
NOP
LOOPL2
JMPL3
;---------------------
SEND:
MOVDX,Z8251
W1:
INAL,DX
TESTAL,01H
JZW1
MOVDX,D8251
MOVAL,AH
OUTDX,AL
RET
;---------------------------
ORG3550H;PC-TX,88-RX
R8251:
MOVDX,Z8251
MOVAL,COM_MOD
OUTDX,AL;8bit,*16
MOVAL,COM_COM;
OUTDX,AL
L5:
CALLWP
;-----------------------
L4:
MOVBX,OFFSETBUF
MOVCX,0006H
L6:
pushcx
pushbx
CALLRECV
popbx
popcx
CMPAL,0DH
JZL5
CALLSUBB
CMPAL,20H
JZL6
MOV[BX],AL
INCBX
LOOPL6
JMPL4
;---------------------
SUBB:
CMPAL,30H
JCL7
CMPAL,3AH
JCL8
CMPAL,41H
JCL7
CMPAL,47H
JNCL7
SUBAL,37H
RET
L8:
SUBAL,30H
RET
L7:
MOVAL,20H
RET
;-------------------
RECV:
MOVDX,Z8251
W11:
INAL,DX
TESTAL,02H
JNZW22
CALLDIS
JMPW11
W22:
MOVDX,D8251
INAL,DX
MOVAH,AL
MOVDX,Z8251
W33:
INAL,DX
TESTAL,02H
JNZW33
W44:
INAL,DX
TESTAL,02H
JNZW44
MOVAL,AH
RET
;----------------实验十一8251串口实验
(1)自发自收--------------------
ORG35C0H;TX=RX
MOVBX,0400H
MOVAL,[BX]
CMPAL,00H
JNZSR0
SR8251:
MOVDX,Z8251
MOVAL,COM_MOD
OUTDX,AL;
MOVAL,COM_COM;
OUTDX,AL
MOVAL,01H
MOVBX,0400H
MOV[BX],AL
SR0:
CALLWP
MOVSI,4000H
MOVDI,5000H
MOVCX,0010H
SR1:
MOVAH,[SI]
CALLSEND
CALLRX
MOV[DI],AH
INCSI
INC
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 8088 系列 十六位 微机 实验 指导书
![提示](https://static.bdocx.com/images/bang_tan.gif)