计算机控制实验程序学生.docx
《计算机控制实验程序学生.docx》由会员分享,可在线阅读,更多相关《计算机控制实验程序学生.docx(49页珍藏版)》请在冰豆网上搜索。
计算机控制实验程序学生
计算机控制技术
实验程序集
河南大学
计算机与信息工程学院
STACKSEGMENTSTACK
DW256DUP(?
)
STACKENDS
CODESEGMENT
ASSUMECS:
CODE
START:
MOVAL,90H
OUT63H,AL
MOVAL,0A4H
OUT43H,AL
MOVAL,17H
OUT42H,AL
AGAIN:
CALLDELAY
INAL,60H
OUT00H,AL
PUSHAX
MOVAX,0001H
INT10H
POPAX
CALLDISPLAY
JMPAGAIN
DELAY:
PUSHCX
MOVCX,3000H
DEL1:
PUSHAX
POPAX
LOOPDEL1
POPCX
RET
DISPLAY:
MOVCL,04H
MOVDL,AL
SHRAL,CL
CMPAL,09H
JBEDIS1
ADDAL,07H
DIS1:
ADDAL,30H
MOVAH,01H
INT10H
ANDDL,0FH
CMPDL,09H
JBEDIS2
ADDDL,07H
DIS2:
ADDDL,30H
MOVAL,DL
MOVAH,01H
INT10H
RET
CODEENDS
ENDSTART
STACKSEGMENTSTACK
DW256DUP(?
)
STACKENDS
CODESEGMENT
ASSUMECS:
CODE
START:
MOVAL,90H
OUT63H,AL
MOVAL,0A4H
OUT43H,AL
MOVAL,17H
OUT42H,AL
MOVAX,2000H+OFFSETIRQ7
MOVSI,003CH
MOV[SI],AX
MOVAX,0000H
MOVSI,003EH
MOV[SI],AX
CLI
INAL,21H
ANDAL,7FH
OUT21H,AL
MOVAL,00H
OUT61H,AL
MOVBL,40H
MOVAL,06H
OUT61H,AL
MOVCH,06H
AGAIN:
STI
HLT
JMPAGAIN
IRQ7:
PUSHAX
INAL,60H
OUT00H,AL
MOVAL,BL
OUT61H,AL
CALLDELAY
MOVAL,00H
OUT61H,AL
MOVAL,CH
CMPAL,06H
JZCY
MOVBL,40H
MOVAL,06H
OUT61H,AL
MOVCH,06H
JMPCY1
CY:
MOVBL,80H
MOVAL,07H
OUT61H,AL
MOVCH,07H
CY1:
MOVAL,20H
OUT20H,AL
POPAX
IRET
DELAY:
PUSHCX
MOVCX,0010H
DEL1:
LOOPDEL1
POPCX
RET
DELAY2:
PUSHCX
MOVCX,0068H
DEL2:
LOOPDEL2
POPCX
RET
CODEENDS
ENDSTART
STACKSEGMENTSTACK
DW256DUP(?
)
STACKENDS
DATASEGMENT
TKDB(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
PUSHDS
MOVAL,90H
OUT63H,AL
MOVAL,0A4H
OUT43H,AL
MOVAL,2EH
OUT42H,AL
MOVAX,0000H
MOVDS,AX
MOVAX,2000H+OFFSETIRQ7
MOVSI,003CH
MOV[SI],AX
MOVAX,0000H
MOVSI,003EH
MOV[SI],AX
POPDS
CLI
INAL,21H
ANDAL,7FH
OUT21H,AL
MOVBL,TK
AGAIN:
STI
HLT
JMPAGAIN
IRQ7:
DECBL
JNZCLEAR_DA
INAL,60H
OUT00H,AL
MOVBL,TK
FINISH:
MOVAL,20H
OUT20H,AL
IRET
CLEAR_DA:
MOVAL,80H
OUT00H,AL
JMPFINISH
CODEENDS
ENDSTART
STACKSEGMENTSTACK
DW256DUP(?
)
STACKENDS
DATASEGMENT
TKDB(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
PUSHDS
MOVAL,90H
OUT63H,AL
MOVAL,0A4H
OUT43H,AL
MOVAL,2EH
OUT42H,AL
MOVAX,0000H
MOVDS,AX
MOVAX,2000H+OFFSETIRQ7
MOVSI,003CH
MOV[SI],AX
MOVAX,2000H+OFFSETIRQ6
MOVSI,0038H
MOV[SI],AX
MOVAX,0000H
MOVSI,003EH
MOV[SI],AX
MOVSI,003AH
MOV[SI],AX
POPDS
CLI
INAL,21H
ANDAL,3FH
OUT21H,AL
MOVAL,80H
OUT00H,AL
MOVBL,01H
AGAIN:
STI
HLT
JMPAGAIN
IRQ7:
DECBL
JNZFINISH
INAL,60H
OUT00H,AL
MOVBL,TK
FINISH:
MOVAL,20H
OUT20H,AL
IRET
IRQ6:
CALLDELAY
MOVAL,80H
OUT00H,AL
MOVBL,01H
JMPFINISH
DELAY:
PUSHCX
MOVCX,1000H
DEL1:
PUSHAX
POPAX
LOOPDEL1
POPCX
RET
CODEENDS
ENDSTART
STACKSEGMENTSTACK
DW256DUP(?
)
STACKENDS
DATASEGMENT
TKDB20H
CCDB95
NCCDW(?
)
aDB05
NaDW(?
)
aYkDW0000H
XkDW(?
)
MARKDB01H
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
PUSHDS
MOVAX,0000
MOVDS,AX
MOVAL,90H
OUT63H,AL
MOVAL,0A4H
OUT43H,AL
MOVAL,17H
OUT42H,AL
MOVAX,2000H+OFFSETIRQ6
MOVSI,0038H
MOV[SI],AX
MOVAX,2000H+OFFSETIRQ7
MOVSI,003CH
MOV[SI],AX
MOVAX,0000H
MOVSI,003EH
MOV[SI],AX
MOVSI,003AH
MOV[SI],AX
MOVaYk,AX
MOVMARK,AL
POPDS
CLI
INAL,21H
ANDAL,3FH
OUT21H,AL
MOVSI,OFFSETCC
MOVCL,02H
CALLDATACHANGE
MOVBL,01H
MOVAL,80H
OUT00H,AL
AGAIN:
STI
HLT
JMPAGAIN
DATACHANGE:
ANDAL,AL
MOVDX,0000H
MOVBL,0FH
MOVAL,[SI]
GOON:
ADDAL,AL
DAA
RCLDX,0001H
DECBL
JNZGOON
INCSI
MOV[SI],DX
INCSI
INCSI
DECCL
JNZDATACHANGE
RET
IRQ7:
DECBL
JNZFINISH
INAL,60H
SUBAL,80H
MOVAH,AL
MOVAL,00H
MOVDX,NCC
MOVXk,AX
IMULDX
MOVAL,MARK
CMPAL,00H
JZWF
MOVAX,aYk
ADDDX,AX
MOVAL,DH
ADDAL,80H
OUT00H,AL
MOVAX,Na
IMULDX
FIN:
MOVaYk,DX
MOVBL,TK
FINISH:
MO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