《微型计算机原理及应用——习题解答、实验指导及课程设计》由会员分享,可在线阅读,更多相关《微型计算机原理及应用——习题解答、实验指导及课程设计(7页珍藏版)》请在金锄头文库上搜索。
1、实验一:编程练习1)STACKSEGMENT STACKDW 64 DUP (?)STACK ENDSDATA SEGMENTORG 0500HDATA1DB 25H, 30H, 32H, 34H, 65HDATA2DB 5 DUP (?)DATAENDSCODE SEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AXMOV AH, 0FFHMOV CX, 05HLEA SI, DATA1LEA DI, DATA2NEXT:MOV AL, SICMP AL, 3AHJNC FF1CMP AL, 30HJC FF1SUB AL,
2、30HMOV DI, ALBACK:INC SIINC DILOOP NEXTJMP DONEFF1:MOV DI, AHJMP BACKDONE:MOV AH, 4CHINT 21HCODEENDSEND START2)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATA SEGMENTORG 0500HDATA1DW 00AAHORG 0510HDATA2DB 5 DUP (?)DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DA
3、TA1MOV DI, OFFSET DATA2MOV CX, 05HMOV AX, SIDONE:XOR DX, DXMOV BX, 0AHDIV BXADD DL, 30HMOV DI, DLINC DILOOP DONEMOV AH, 4CHINT 21HCODEENDSEND START3)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0500HDATA1DB 2 DUP (?)ORG 050AHDATA2DB 4 DUP (?)DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTAR
4、T:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DATA1MOV DI, OFFSET DATA2MOV CX, 0400HA:MOV AX, SIADD CL, 04HROL AX, CLAND AL, 0FHADD AL, 30HMOV DI, ALINC DIDEC CHJNZ AMOV AH, 4CHINT 21HCODEENDSEND START4)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0500HDATA1DW 0102H, 0304H, 0506H, 0708HORG 0510HD
5、ATA2DW 4 DUP (?)DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DATA1MOV DI, OFFSET DATA2MOV CL, 04HMOV CH, 0AHA:MOV BX, SIMOV AL, BHMUL CHADD AL, BLMOV AH, 00HMOV DI, AXADD SI, 02HADD DI, 02HDEC CLJNZ AMOV AH, 4CHINT 21HCODEENDSEND START5)STACKSEGMENT STACKDW
6、64 DUP (?)STACKENDSDATASEGMENTORG 0600HDATA1DB 12H, 34H, 56H, 78HORG 0610HDATA2DB 4 DUP (?)DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DATA1MOV DI, OFFSET DATA2MOV CX, 0404HMOV DL, 0AHA:MOV AL, SIAND AL. 0F0HROL AL, CLMUL DLMOV AH, SIAND AH, 0F0HADD AL, AHM
7、OV DI, ALINC SIINC DIDEC CHJNZ AMOV AH, 4CHINT 21HCODEENDSEND START6)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0300HDATA1DW 01ABHORG 030AHDATA2DB 3 DUP (?)DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DATA1MOV DI, OFFSET DATA2MOV AX, SIMOV BL,64H
8、 DIV BL MOV DI, AL MOV AL, AH MOV AH,00H MOV BL,0AH DIV BL MOV DI+1, AL MOV DI+2, AH MOV AH,4CH INT 21H CODEENDS END START实验二:编程练习1)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0700HXDW 0208HYDW 0509HZDW 0304HORG 0710HQDW ?DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV D
9、S. AXMOV SI, OFFSET XMOV DI, OFFSET YMOV AL, SI+1MOV BL, DI+1ADD AL, BLAAAMOV AH, ALMOV AL, SIMOV BL, DIADD AL, BLAAAMOV DX, AXMOV SI, OFFSET ZMOV DI, OFFSET QMOV AL, DHMOV BL, SI+1SUB AL, BLAASMOV AH, ALMOV AL, DLMOV BL, SISUB AL, BLAASMOV DI, ALMOV DI+1, AHMOV AH,4CHINT 21HCODEENDSEND START2)STACK
10、SEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0500HDATA1DB 10H, 20H, 30H, 40H, 50H, 60HORG 0510HDATA2DB ?CODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DATA1MOV DI, OFFSET DATA2XOR DX, DXMOV CX, 6A1:MOV AL, SICBWADD DX, AXINC SILOOP A1MOV AX, DXMOV BL, 06HDIV BLMO
11、V BL, 0AHDIV BLMOV DI, AXMOV AH, 4CHINT 21HCODEENDSEND START2)OPTIONALSTART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DATA1MOV DI, OFFSET DATA2MOV CX,0006H MOV AX,0000H A: MOV BL, SIINC SIADD AL, BLADC AH,00HLOOP AMOV CL,06HDIV CLMOV AH,00HMOV BL,0AHDIV BLMOV BH, AHMOV BL,10HMUL BLADD AL, BHMOV DI, ALMOV
12、 AH,4CHINT 21HCODEENDSEND START3)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0500HDATA1DB 10H, 15H, 0FHORG 0510HDATA2DB 3 DUP (?)DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DATA1MOV DI, OFFSET DATA2MOV AL, SIMOV BL, SI+1ADD AL, BLMOV BL, SI+2ADD
13、AL, BLMOV CL,02HSAL AL, CLMOV AH,00HMOV CX,03HDONE:XOR DX, DXMOV BX, 0AHDIV BXMOV DI, DLINC DILOOP DONEMOV AH, 4CHINT 21HCODEENDSEND START4)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0550HDATA1DB 98H, 76H, 54H, 32H, 19H, 87H, 67H, 65HORG 0558HDATA2DB 98H, 76H, 54H, 32H, 19H, 87H, 67H, 65
14、HORG 0560HDATA3DB 9 DUP (?)DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET DATA1MOV DI, OFFSET DATA2MOV CX, 0008HA:MOV AL, SIMOV BL, DIPUSH AXPUSH BXINC SIINC DILOOP AMOV CX, 0008HMOV SI, OFFSET DATA3ADD SI, CXCLCB:POP AXPOP BXADC AL, BLMOV SI, ALDEC SILOOP BAD
15、C CL, 00HMOV SI, CLMOV AH, 4CHINT 21HCODEENDSEND START5)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0300HXDW 0608HYDW 0509HZDW 0306HORG 0310HQDW ?DATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESRART:MOV AX, DATAMOV DS, AXMOV SI, OFFSET QMOV CX, XMOV BX, YMOV AH,00HMOV AL, CHSUB AL, BHAASMOV
16、CH, AHMOV AH, ALMOV AL, CLSUB AL, BLAASMOV CX, AXMOV BX, ZMOV AH,00HMOV AL, CHADD AL, BHAAAMOV CH, AHMOV AH, ALMOV AL, CLADD AL, BLAAAMOV SI, AHMOV SI+1, ALMOV AH,4CHINT 21HCODEENDSEND START6)STACKSEGMENT STACKDW 64 DUP (?)STACKENDSDATASEGMENTORG 0550HDATADB NUM DB 65H, 67H, 87H, 19H, 32H, 54H, 76H, 98H, 77H, 39H, 32H, 48H, 95H, 28H, 43H, 56HDATAENDSCODESEGMENTASSUME DS: DATA, CS: CODESTART:MOV AX, DATAMOV DS, AX