直流电机闭环调速原理及汇编程序语言.docx
- 文档编号:8043075
- 上传时间:2023-01-28
- 格式:DOCX
- 页数:20
- 大小:323.47KB
直流电机闭环调速原理及汇编程序语言.docx
《直流电机闭环调速原理及汇编程序语言.docx》由会员分享,可在线阅读,更多相关《直流电机闭环调速原理及汇编程序语言.docx(20页珍藏版)》请在冰豆网上搜索。
直流电机闭环调速原理及汇编程序语言
实验五直流电机闭环调速实验
STACKSEGMENTSTACK
DW256DUP(?
)
TOPLABELWORD
STACKENDS
DATASEGMENT
TSDB14H
SPECDW0020H
IBANDDW0060H
KPPDW1060H
KIIDW0010H
KDDDW0020H
CH1DB?
CH2DB?
YKDW?
CKDB?
VADDDW?
ZVDB?
ZVVDB?
TCDB?
FPWMDB?
CK_1DB?
EK_1DW?
AEK_1DW?
BEKDW?
AAADB?
VAADB?
BBBDB?
VBBDB?
MARKDB?
R0DW?
R1DW?
R2DW?
R3DW?
R4DW?
R5DW?
R6DW?
R7DB?
R8DW?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MAIN:
CALLSYSTEM
CALLINIT
STI
M1:
MOVAL,TS
SUBAL,TC
JNCM1
MOVTC,00H
MOVAL,ZVV
MOVAH,00H
MOVYK,AX
CALLPID
MOVAL,CK
SUBAL,80H
JCIS0
MOVAAA,AL
JMPCOU
IS0:
MOVAL,10H
MOVAAA,AL
COU:
MOVAL,7FH
SUBAL,AAA
MOVBBB,AL
MOVAX,SPEC
MOVCH1,AL
MOVAX,YK
MOVCH2,AL
CALLPUT_COM
JMPM1
PUT_COM:
MOVAL,31H
OUT0C1H,AL
MOVAL,CH1
OUT0C0H,AL
WAIT1:
INAL,0C1H
TESTAL,01H
JZWAIT1
MOVAL,CH2
OUT0C0H,AL
WAIT2:
INAL,0C1H
TESTAL,01H
JZWAIT2
MOVAL,34H
OUT0C1H,AL
RET
INIT:
NOP
PUSHDS
XORAX,AX
MOVDS,AX
MOVAX,OFFSETIRQ6
ADDAX,2000H
MOVSI,0038H
MOV[SI],AX
MOVAX,0000H
MOVSI,003AH
MOV[SI],AX
MOVAX,OFFSETIRQ7
ADDAX,2000H
MOVSI,003CH
MOV[SI],AX
MOVAX,0000H
MOVSI,003EH
MOV[SI],AX
CLI
POPDS
INAL,21H
ANDAL,3FH
OUT21H,AL
MOVVADD,0000H
MOVZV,00H
MOVZVV,00H
MOVCK,00H
MOVYK,0000H
MOVCK_1,00H
MOVEK_1,0000H
MOVAEK_1,0000H
MOVBEK,0000H
MOVBBB,00H
MOVVBB,00H
MOVR0,0000H
MOVR1,0000H
MOVR2,0000H
MOVR3,0000H
MOVR4,0000H
MOVR5,0000H
MOVR6,0000H
MOVR7,00H
MOVR8,0000H
MOVMARK,00H
MOVFPWM,01H
MOVAAA,7FH
MOVVAA,7FH
MOVTC,00H
MOVAL,80H
OUT63H,AL
MOVAL,00H
OUT61H,AL
MOVAL,0B6H
OUT43H,AL
MOVAL,8FH
OUT42H,AL
MOVAL,04H
OUT42H,AL
RET
SYSTEM:
MOVAL,76H
OUT43H,AL
MOVAL,0CH
OUT41H,AL
MOVAL,00H
OUT41H,AL
MOVAL,00H
OUT0C1H,AL
CALLDLY1
OUT0C1H,AL
CALLDLY1
OUT0C1H,AL
CALLDLY1
OUT0C0H,AL
CALLDLY1
OUT0C0H,AL
CALLDLY1
MOVAL,40H
OUT0C1H,AL
CALLDLY1
MOVAL,7EH
OUT0C1H,AL
CALLDLY1
MOVAL,34H
OUT0C1H,AL
CALLDLY1
INAL,21H
ORAL,01H
OUT21H,AL
RET
DLY1:
NOP
PUSHCX
MOVCX,3000H
B2:
PUSHAX
POPAX
LOOPB2
POPCX
RET
IRQ7:
NOP
PUSHAX
PUSHBX
PUSHCX
PUSHDX
PUSHF
MOVAL,MARK
CMPAL,01H
JZIN1
MOVMARK,01H
IN2:
NOP
MOVAL,20H
OUT20H,AL
POPF
POPDX
POPCX
POPBX
POPAX
IRET
IN1:
MOVMARK,00H
CALLVV
MOV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:
MOVAX,R5
ADDAX,R2
MOVR6,AX
JOL3
L5:
MOVAX,R6
MOVCX,KPP
IMULCX
MOVCX,1000H
IDIVCX
MOVCX,AX
RCLAH,01H
PUSHF
RCRAL,01H
POPF
JCLLL1
CMPCH,00H
JZLLL2
MOVAL,7FH
JMPLLL2
LLL1:
CMPCH,0FFH
JZLLL2
MOVAL,80H
LLL2:
MOVR7,AL
ADDAL,CK_1
JOL8
L18:
MOVCK_1,AL
ADDAL,80H
MOVCK,AL
RET
L8:
TESTR7,80H
JNZL17
MOVAL,7FH
JMPL18
L17:
MOVAL,80H
JMPL18
L9:
TESTR3,8000H
JNZL1
MOVR5,7FFFH
JMPL2
L1:
MOVR5,8000H
JMPL2
L3:
TESTR2,8000H
JNZL4
MOVR6,7FFFH
JMPL5
L4:
MOVR6,8000H
JMPL5
CODEENDS
ENDSTART
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 直流电机 闭环 调速 原理 汇编程序 语言