微机实验程序.docx
- 文档编号:26905865
- 上传时间:2023-06-23
- 格式:DOCX
- 页数:63
- 大小:19.85KB
微机实验程序.docx
《微机实验程序.docx》由会员分享,可在线阅读,更多相关《微机实验程序.docx(63页珍藏版)》请在冰豆网上搜索。
微机实验程序
说明:
本份资料仅供备考使用,程序的正确性有待进一步验证。
1.1
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3500H
DATA1DB5DUP(?
)
ORG350AH
DATA2DB5DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
LEASI,DATA1
LEADI,DATA2
MOVCX,0005H
MOVAH,00H
A1:
MOVAL,[SI]
SUBAL,30H
JCERROR
ADDAL,30H
MOVBL,39H
SUBBL,AL
JCERROR
SUBAL,30H
MOV[DI],AL
INCDI
INCSI
LOOPA1
JMPSTOP
ERROR:
MOV[DI],0FFFFH
INCDI
INCSI
LOOPA1
STOP:
HLT
INT03H
CODEENDS
ENDSTART
1.2
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3500H
DATA1DB2DUP(?
)
ORG3510H
DATA2DB5DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVDI,OFFSETDATA1
MOVSI,OFFSETDATA2
MOVAX,[DI]
MOVBX,2710H;十进制数的10000
MOVCX,0005H
A1:
MOVDX,0000H
DIVBX
ADDAL,30H
MOV[SI],AL
INCSI
PUSHDX
MOVAX,BX
MOVBX,0AH
MOVDX,0000H
DIVBX
MOVBX,AX
POPDX
MOVAX,DX
LOOPA1
INT03H
CODEENDS
ENDSTART
1.3
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3500H
DATA1DB2DUP(?
)
ORG350AH
DATA2DB4DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVDI,OFFSETDATA1
MOVSI,OFFSETDATA2
MOVAX,[DI]
MOVCX,0004H
MOVBX,1000H
A1:
MOVDX,0000H
DIVBX
CMPAL,0AH
JAEA3
ADDAL,30H
A2:
MOV[SI],AL
INCSI
PUSHDX
MOVAX,BX
MOVBX,0010H
MOVDX,0000H
DIVBX
MOVBX,AX
POPDX
MOVAX,DX
LOOPA1
INT03H
A3:
SUBAL,0AH
ADDAL,41H
JMPA2
CODEENDS
ENDSTART
1.4
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3500H
DATA1DB8DUP(?
)
ORG3510H
DATA2DB8DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVDI,OFFSETDATA1
MOVSI,OFFSETDATA2
MOVCX,0004H
MOVBL,0AH
MOVAH,00H
A1:
MOVAL,[DI]
MULBL
INCDI
MOVDL,[DI]
ADDAL,DL
MOV[SI],AL
INCDI
INCSI
LOOPA1
INT03H
CODEENDS
ENDSTART
1.5
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3600H
DATA1DB?
ORG3610H
JIEGUODB?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
LEASI,DATA1
LEADI,JIEGUO
XORCH,CH
MOVCL,04H
MOVDL,0AH
MOVDH,04H
A1:
MOVAL,[SI]
ANDAL,0FH
MOVBL,AL
MOVAL,[SI]
SHRAL,CL
MULDL
ADDAL,BL
MOV[DI],AL
INCSI
INCDI
DECDH
JNZA2
JMPA3
A2:
JMPA1
A3:
INT03H
CODEENDS
ENDSTART
1.6
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3500H
DATA1DB2DUP(?
)
ORG3510H
DATA2DB5DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVDI,OFFSETDATA1
MOVSI,OFFSETDATA2
MOVAX,[DI]
MOVBX,2710H;十进制数的10000
MOVCX,0005H
A1:
MOVDX,0000H
DIVBX
MOV[SI],AL
INCSI
PUSHDX
MOVAX,BX
MOVBX,0AH
MOVDX,0000H
DIVBX
MOVBX,AX
POPDX
MOVAX,DX
LOOPA1
INT03H
CODEENDS
ENDSTART
2.1
STACKSEGMENTSTACK
DW64(?
)
STACKENDS
DATASEGMENT
ORG3700H
XLDB08H
XHDB02H
YLDB09H
YHDB05H
ZLDB04H
ZHDB03H
ORG3710H
QLDB?
QHDB?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVAH,00H
MOVDH,01H
MOVDL,0AH
MOVAL,XL
ADDAL,YL
CMPAL,0AH
JAEM1
A1:
CMPAL,ZL
JBM2
A2:
SUBAL,ZL
MOVQL,AL
ADDAH,XH
ADDAH,YH
SUBAH,ZH
MOVQH,AH
JMPSTOP
M1:
ADDAH,DH
SUBAL,DL
JMPA1
M2:
SUBAH,DH
ADDAL,DL
JMPA2
STOP:
HLT
INT03H
CODEENDS
ENDSTART
2.2
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3000H
DATA1DB10H,20H,30H,40H,50H,60H
ORG3010H
JIEGUODW?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVSI,OFFSETDATA1
MOVDI,OFFSETJIEGUO
MOVCX,0005H
MOVAL,[SI]
MOVAH,00H
A1:
INCSI
ADDAL,[SI]
JCA2
LOOPA1
A2:
INCAH
LOOPA1
MOVBL,06H
DIVBL
MOV[DI],AL
INCDI
MOVDL,0AH
MOVAH,00H
DIVDL
MOV[DI],AL
MOV[DI+01H],AH
INT03H
CODEENDS
ENDSTART
2.3
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3500H
DATA1DB?
ORG3510H
JIEGUODB?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
LEASI,DATA1
LEADI,JIEGUO
MOVCX,0002H
MOVAL,[SI]
A1:
INCSI
ADDAL,[SI]
LOOPA1
MOV[DI],AL
INCDI
MOVBL,04H
MULBL
MOVDL,64H
MOVAH,00H
DIVDL
MOV[DI],AL
INCDI
MOVAL,AH
MOVAH,00H
MOVDL,0AH
DIVDL
MOV[DI],AL
INCDI
MOV[DI],AH
INT03H
CODEENDS
ENDSTART
2.4
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3050H
DATA1DW8DUP(?
)
ORG3060H
JIEGUODW?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
LEASI,DATA1
LEADI,JIEGUO
MOVCX,0004
MOVAH,00H
SAHF
A1:
MOVAX,[SI]
ADCAX,[SI+08H]
MOVWORDPTR[DI],AX
INCDI
INCDI
INCSI
INCSI
LOOPA1
INT03H
CODEENDS
ENDSTART
2.5
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3300H
XLDB08H
XHDB06H
YLDB09H
YHDB05H
ZLDB06H
ZHDB03H
ORG3310H
QDB?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVDI,OFFSETQ
A1:
MOVAL,XL
CMPAL,ZL
JBA2
M1:
SUBAL,YL
MOVAH,XH
SUBAH,YH
ADDAL,ZL
CMPAL,0AH
JAEA3
M2:
MOV[DI],AL
INCDI
ADDAH,ZH
MOV[DI],AH
JMPA4
A2:
DECAH
ADDAL,0AH
JMPM1
A3:
INCAH
SUBAL,0AH
JMPM2
A4:
INT03H
CODEENDS
ENDSTART
2.6
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3000H
XDQ9876543219876765H
YDQ5643289548323977H
JIEGUODW?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
LEASI,X
LEADI,JIEGUO
MOVCX,0004H
A1:
MOVAX,[SI]
MOVBX,[SI+08H]
SBBAX,BX
MOVWORDPTR[DI],AX
INCDI
INCDI
INCSI
INCSI
LOOPA1
INT03H
CODEENDS
ENDSTART
3.1
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3500H
DATA1DB26DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVDI,OFFSETDATA1
MOVCL,[DI]
XORCH,CH
MOVBL,CH
MOVDH,CH
MOVDL,CH
INCDI
A1:
MOVAL,[DI]
TESTAL,80H
JEA2
INCBL
INCDI
LOOPA1
JMPA4
A2:
CMPAL,00H
JEA3
INCDH
INCDI
LOOPA1
JMPA4
A3:
INCDL
INCDI
LOOPA1
JMPA4
A4:
MOV[DI+06H],DH
MOV[DI+07H],BL
MOV[DI+08H],DL
INT03H
CODEENDS
ENDSTART
3.2
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3200H
DATA1DB4DUP(?
)
ORG3204H
DATA2DB2DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVDI,OFFSETDATA1
MOVSI,OFFSETDATA2
MOVCX,0003H
MOVBL,[DI]
MOVDL,[DI+01H]
MOVDH,[DI+02H]
A1:
CMPBL,DL
JEA2
CMPBL,DH
JEA3
MOV[SI],DI
JMPSTOP
A2:
CMPBL,DH
JEA4
ADDDI,0002H
MOV[SI],DI
JMPSTOP
A3:
ADDDI,0001H
MOV[SI],DI
JMPSTOP
A4:
MOV[SI],0FFFFH
STOP:
INT03H
CODEENDS
ENDSTART
3.3
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3000H
SCOREDB20DUP(?
)
ORG3100H
TOTDB5DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
MOVDI,OFFSETSCORE
MOVSI,OFFSETTOT
XORAH,AH
MOVBL,AH
MOVBH,AH
MOVDL,AH
MOVDH,AH
MOVCX,0014H
A1:
MOVAL,[DI]
CMPAL,5AH
JBA2
INCAH
INCDI
LOOPA1
JMPA6
A2:
CMPAL,50H
JBA3
INCBL
INCDI
LOOPA1
JMPA6
A3:
CMPAL,46H
JBA4
INCBH
INCDI
LOOPA1
JMPA6
A4:
CMPAL,3CH
JBA5
INCDL
INCDI
LOOPA1
JMPA6
A5:
INCDH
INCDI
LOOPA1
JMPA6
A6:
MOV[SI],DH
MOV[SI+01H],DL
MOV[SI+02H],BH
MOV[SI+03H],BL
MOV[SI+04H],AH
INT03H
CODEENDS
ENDSTART
3.4
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3000H
TOTALDW?
DATA1DB?
ORG3100H
DATA2DB?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
LEASI,DATA1
LEADI,DATA2
MOVCX,TOTAL
MOVAL,[SI]
A1:
CMPAL,[SI+1]
JNCBIG
MOVAL,[SI+1]
BIG:
INCSI
LOOPA1
MOV[DI],AL
MOVCX,TOTAL
SUBSI,CX
A2:
CMPAL,[SI]
JZA3
INCSI
LOOPA2
A3:
INCDI
MOV[DI],SI
INT03H
CODEENDS
ENDSTART
3.5
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3000H
XDB?
ORG3005H
YDB?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
LEASI,X
LEADI,Y
MOVCX,0003H
A1:
MOVAL,[SI]
INCSI
ANDAL,AL
JNSA2
MOVBYTEPTR[DI],0BH
INCDI
LOOPA1
JMPEXIT
A2:
JZA3
MOVBYTEPTR[DI],0AH
INCDI
LOOPA1
JMPEXIT
A3:
MOVBYTEPTR[DI],00H
INCDI
LOOPA1
EXIT:
INT03H
CODEENDS
ENDSTART
3.6
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3200H
XDB?
ORG3205H
YDB?
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,DATA
MOVDS,AX
LEASI,X
LEADI,Y
MOVCX,0003H
A1:
MOVAL,[SI]
INCSI
CMPAL,0C8H
JBEA2
MOVBYTEPTR[DI],90H
INCDI
LOOPA1
JMPEXIT
A2:
CMPAL,64H
JNZA3
MOVBYTEPTR[DI],50H
INCDI
LOOPA1
JMPEXIT
A3:
CMPAL,32H
JAEA4
MOVBYTEPTR[DI],00H
INCDI
A4:
LOOPA1
EXIT:
INT03H
CODEENDS
ENDSTART
4.1
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
DATA1DB'MYNAMEISLIJIANQIANG.$'
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
LEADX,DATA1
MOVAH,09H
INT21H
MOVAH,4CH
INT21H
CODEENDS
ENDSTART
4.2
STACKSEGMENTSTACK
DW64DUP(?
)
STACKENDS
DATASEGMENT
ORG3500H
DATA1DB4DUP(?
)
DATAENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA,SS:
STACK
START:
MOVAX,DATA
MOVDS,AX
LEADI,DATA1
MOVCX,0004H
MOVBX,1234H
MOVAX,6666H
SUBAX,BX
ADDAX,5678H
MOVBX,1000H
A1:
MOVDX,0000H
DIVBX
CMPAL,0AH
JAEA4
ADDAL,30H
A2:
MOV[DI],AL
INCDI
PUSHDX
MOVAX,BX
M
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 微机 实验 程序