版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、微機(jī)原理與接口技術(shù)實驗報告實驗 匯編實驗 專業(yè): 電力系統(tǒng)自動化 班級: 電力1203 學(xué)號: 201201000911 姓名: 李國杰 預(yù)習(xí)報告成績 實驗成績: 機(jī)位號: 試驗一:數(shù)據(jù)塊傳送1 將數(shù)據(jù)段中2000H單元開始存放的的10個數(shù)(8位數(shù))傳送到3000H開始的10個字節(jié)中。源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2000H DATA1 DB 1,2,3,4,5,6,7,8,9,10 ORG 3000H DATA2 DB 10 DUP(0)DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT
2、ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV SI,2000H MOV DI,3000H MOV CX,10NEXT:MOV AL,SI MOV DI,AL INC DI INC SI DEC CX JNZ NEXT MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示: 2 將數(shù)據(jù)段中2000H單元開始存放的10個數(shù)(16位數(shù))傳送到3000H開始到的10個字節(jié)中。源程序: DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2000H DATA
3、1 DW 1,2,3,4,5,6,7,8,9,10 ORG 3000H DATA2 DW 10 DUP(0)DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV SI,2000H MOV DI,3000H MOV CX,10NEXT:MOV AL,SI MOV DI,AL INC DI INC SI DEC CX JNZ NEXT MOV AH,4CH INT 21HCOD
4、ES ENDSEND START結(jié)果展示:3 將數(shù)據(jù)DATA1中的10個字節(jié)數(shù)據(jù)傳送到數(shù)據(jù)段DATA2中源程序: DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 DATA1 DB 1,2,3,4,5,6,7,8,9,10 DATA2 DB 10 DUP(0)DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV SI,OFFSET DATA1 MOV DI,OFFSET D
5、ATA2 MOV CX,10NEXT:MOV AL,SI MOV DI,AL INC DI INC SI DEC CX JNZ NEXT MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:4 將數(shù)據(jù)段中2000H開始的20個數(shù)據(jù)傳送到2010H開始的20個單元中。源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 DATA1 DB 1,2,3,4,5,6,7,8,9,10 DATA2 DB 10 DUP(0)DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODE
6、S,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV SI,OFFSET DATA1 MOV DI,OFFSET DATA2 MOV CX,10NEXT:MOV AL,SI MOV DI,AL INC DI INC SI DEC CX JNZ NEXT MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:實驗二:查表實驗?zāi)康模菏煜嶒灜h(huán)境;熟練掌握查表程序1. 已知015的平方值表,查表求X的平方值,送到Y(jié)單元,用兩種方法方法一:源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼
7、TABLE DB 0,1,4,9,16,25,36,49,64,81 DB 100,121,144,169,196,225 DATA DB 4 RESULT DB ? DATAS ENDSSTACKS SEGMENT PARA STACK ;此處輸入堆棧段代碼 DW 50 DUP (0)STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV AX,STACKS MOV SS,AX MOV BX,OFFSET TABLE MOV AH,0 MOV
8、 AL,DATA ADD BX,AX MOV AL,BX MOV RESULT,AL MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:方法二:源程序:結(jié)果展示:2. 已知0255的平方值表,查表求X的平方值,送到Y(jié)單元源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 TABLE DW 0,1,4,9,16,25,36,49,64,81 DW 100,121,144,169,196,225 DATA DW 4 RESULT DW ? DATAS ENDSSTACKS SEGMENT PARA STACK ;此處輸入堆棧段代碼 DW 50 DUP (0)
9、STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV AX,STACKS MOV SS,AX MOV BX,OFFSET TABLE MOV AX,DATA SHL AX,1 ADD BX,AX MOV AX,BX MOV RESULT,AX MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示:實驗三:計算1. 計算1234F000H+98765000H的和DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 D
10、ATA1 DW 0F000H,1234H DATA2 DW 5000h,9876H RESULT DW 2 DUP(?) DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV AX,DATA1 ADD AX,DATA2 MOV BX,DATA1+2 ADC BX,DATA2+2 MOV RESULT,AX MOV RESULT+2,BX MOV AH,4CH INT 21H
11、CODES ENDSEND START結(jié)果展示:2. 計算8字節(jié)數(shù)據(jù)1122334455667788H與 99AABBCCDDEEFF00H的和源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 DATA1 DW 7788H,5566H,3344H,1122H DATA2 DW 0FF00H,0DDEEH,0BBCCH,99AAH RESULT DW 4 DUP(?) DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DAT
12、AS MOV DS,AX ;此處輸入代碼段代碼 MOV AX,DATA1 ADD AX,DATA2 MOV BX,DATA1+2 ADC BX,DATA2+2 MOV CX,DATA1+4 ADC CX,DATA2+4 MOV DX,DATA1+6 ADC DX,DATA2+6 MOV RESULT,AX MOV RESULT+2,BX MOV RESULT+4,CX MOV RESULT+6,DX MOV AH,4CH INT 21HCODES ENDS END START 結(jié)果展示:3. 計算8字節(jié)的BCD碼十進(jìn)制數(shù)1122334455667788H與9988776655443322H的和
13、源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 1000H DATA1 DB 88H,77H,66H,55H,44H,33H,22H,11H DATA2 DB 22H,33H,44H,55H,66H,77H,88H,99H ORG 3000H DATA3 DB 0HDATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA SI,DATA1 LEA DI,DAT
14、A2 LEA BX,DATA3 MOV CX,8 NEXT:MOV AL,SI ADC AL,DI DAA MOV BX,AL INC SI INC DI INC BX DEC CX JNZ NEXT MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:4. 計算10個字節(jié)數(shù)據(jù)的和源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 1000H DATA1 DB 99H,88H,77H,66H,55H,44H,33H,22H,11H,00H DATA2 DB 00H,11H,22H,33H,44H,55H,66H,77H,88H,99H ORG 30
15、00H DATA3 DB 0HDATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA SI,DATA1 LEA DI,DATA2 LEA BX,DATA3 MOV CX,10 NEXT:MOV AL,SI ADC AL,DI MOV BX,AL INC SI INC DI INC BX DEC CX JNZ NEXT MOV AH,4CH INT 21HCODES ENDSE
16、ND START結(jié)果展示:5. 計算10個字?jǐn)?shù)據(jù)的和源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2000H DATA1 DB 20 DUP(0) DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA SI,DATA1 MOV AL,0 MOV BL,1 MOV CL,10 NEXT:ADD AL,BL INC BL DEC CL JNZ NEXT MO
17、V SI,AL MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:實驗四:計算表達(dá)式的值1. 計算表達(dá)式Z=(X-Y)*7)/(Y+2)的值,已知X=10,Y=5源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2000H X DW 10 Y DW 5 Z DW ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV DX,
18、X SUB DX,Y ;DX=X-Y MOV AX,7 MUL DX ;AX=(X-Y)*7 ADD Y,2 ;Y=Y+2 DIV Y MOV Z,AX SUB Y,2 MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:實驗五:找最大數(shù),最小數(shù)1. 找最大、最小數(shù)1 找出2040H單元和2041H單元的大數(shù),送2042H單元(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2040H DATA1 DB 1,2 DATA2 DB 10 DUP(0) DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS
19、 ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV BX,2040H MOV AL,BX INC BX CMP AL,BX JAE NEXT MOV AL,BX NEXT:MOV BX,2042H MOV BX,AL MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:2. 找出10個數(shù)(8位數(shù))里的最大數(shù)(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2000H DATA1 DB 1,
20、2,3,4,5,6,7,8,9,10 MAX DB ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV BX,2000H MOV AL,BX MOV CX,10 NEXT1:INC BX CMP AL,BX JAE NEXT2 MOV AL,BX NEXT2:DEC CX JNZ NEXT1 MOV BX,AL MOV AH,4CH INT 21HCODES ENDSE
21、ND START結(jié)果展示:3. 找出10個數(shù)(8位數(shù))里的最小數(shù)(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2000H DATA1 DB 1,2,3,4,5,6,7,8,9,10 MAX DB ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV BX,2000H MOV AL,BX MOV CX,9 NEXT1:INC BX CMP
22、 AL,BX JBE NEXT2 MOV AL,BX NEXT2:DEC CX JNZ NEXT1 MOV MAX,AL MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示: 4. 找出10個數(shù)(16位數(shù))里的最大數(shù)(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2000H DATA1 DW 1,2,3,4,5,6,7,8,9,10 MAX DW ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:ST
23、ACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV BX,2000H MOV AX,BX MOV CX,9NEXT1:INC BX INC BX CMP AX,BX JAE NEXT2 MOV AX,BXNEXT2:DEC CX JNZ NEXT1 MOV MAX,AX MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示:5. 找出10個數(shù)(16位數(shù))里的最小數(shù)(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 2000H DATA1 DW 1,2,3,4,5,6,7,8,9,10 M
24、AX DW ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV BX,2000H MOV AX,BX MOV CX,9NEXT1:INC BX INC BX CMP AX,BX JBE NEXT2 MOV AX,BXNEXT2:DEC CX JNZ NEXT1 MOV MAX,AX MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示:實
25、驗六:統(tǒng)計正數(shù)、負(fù)數(shù)個數(shù)1. 找出10個數(shù)(8位數(shù))里的正數(shù)個數(shù)(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 TABLE DB 1,-2,3,-4,5,-6,7,-8,9,-10 NUM DB ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA SI,TABLE MOV DX,0H MOV CX,0AHAGAIN: MOV AL,SI INC
26、 SI MOV BX,0 CMP AL,BL JG NEXT INC DXNEXT: DEC CX JNZ AGAIN LEA SI,NUM MOV SI,DX MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示:2. 找出10個數(shù)(8位數(shù))里的負(fù)數(shù)個數(shù)(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 TABLE DB 1,-2,3,-4,5,-6,7,-8,9,-10 NUM DB ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,
27、DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA SI,TABLE MOV DX,0H MOV CX,0AHAGAIN: MOV AL,SI INC SI MOV BX,0 CMP BL,AL JG NEXT INC DXNEXT: DEC CX JNZ AGAIN LEA SI,NUM MOV SI,DX MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示:3. 找出10個數(shù)(16位數(shù))里的正數(shù)個數(shù)(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 TABLE
28、DW 1,-2,3,-4,5,-6,7,-8,9,-10 NUM DB ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA SI,TABLE MOV DX,0H MOV CX,0AHAGAIN: MOV AX,SI INC SI MOV BX,0 CMP BX,AX JG NEXT INC DXNEXT: DEC CX JNZ AGAIN LEA SI,NUM MOV
29、SI,DX MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:4. 找出10個數(shù)(16位數(shù))里的負(fù)數(shù)個數(shù)(數(shù)據(jù)自己定義)源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 TABLE DW 1,-2,3,-4,5,-6,7,-8,9,-10 NUM DB ?DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA SI,TABLE MOV
30、 DX,0H MOV CX,0AHAGAIN: MOV AX,SI INC SI MOV BX,0 CMP AX,BX JG NEXT INC DXNEXT: DEC CX JNZ AGAIN LEA SI,NUM MOV SI,DX MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示:實驗七:1. 比較數(shù)據(jù)段DS與數(shù)據(jù)段ES中的10個字節(jié)的數(shù)據(jù)是否一致?源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 DATA1 DB 0,1,2,3,4,5,6,7,8,9 DATA2 DB 0,1,2,3,4,5,6,7,8,9 RESULT DB ? DATAS
31、 ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA SI,DATA1 LEA DI,DATA2 MOV CX,0AH MOV DX,1HNEXT: MOV AX,SI MOV BX,DI CMP AX,BX JZ AGAIN MOV DX,0AGAIN: INC SI INC DI DEC CX JNZ NEXT LEA SI,RESULT MOV SI,DX MOV AH,4CH
32、 INT 21HCODES ENDSEND START結(jié)果展示:1表示相同2. 比較數(shù)據(jù)段DS與數(shù)據(jù)段ES中的10個字節(jié)的數(shù)據(jù)是否一致?源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 DATA1 DW 0,1,2,3,4,5,6,7,8,9 DATA2 DW 0,1,2,3,4,5,6,7,8,9 RESULT DB ? DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代
33、碼 LEA SI,DATA1 LEA DI,DATA2 MOV CX,0AH MOV DX,1HNEXT: MOV AX,SI MOV BX,DI CMP AX,BX JZ AGAIN MOV DX,0AGAIN: INC SI INC DI DEC CX JNZ NEXT LEA SI,RESULT MOV SI,DX MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:1表示相同實驗八:邏輯運算與移位1. 將數(shù)據(jù)段中4000H單元的內(nèi)容拆開,高位送4001H低位,低位送4002H低位,4001H、4002H的高位清零,一般用于把數(shù)據(jù)送顯示緩沖區(qū)時使用。源程序
34、:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 4000H DATA DB 89HDATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV SI,4000H MOV AL,SI AND AL,0FH MOV SI+2,AL MOV BL,SI SUB BL,AL MOV CL,4 SHR BL,CL MOV SI+1,BL MOV AH,4CH INT 21HCOD
35、ES ENDSEND START結(jié)果展示:2. 將4000H、4001H單元的低位送4002H單元的高、低位,一般用于將緩沖區(qū)的數(shù)據(jù)取出拼成一個字節(jié)。源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 ORG 4000H DATA DB 89H,67HDATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 MOV SI,4000H MOV AL,SI AND AL,0FH MO
36、V CL,4 SHL AL,CL MOV BL,SI+1 AND BL,0FH ADD AL,BL MOV SI+2,AL MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:實驗九:輸入輸出1、 在顯示器上輸出字符串HELLO!源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 STRING DB 'HELLO!'DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS
37、MOV DS,AX ;此處輸入代碼段代碼 LEA BX,STRING MOV CX,6LPP: MOV AH,2 MOV DL,BX INC BX INT 21H LOOP LPP MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:2、 從鍵盤輸入一組字符串,存入到BUFFER數(shù)據(jù)區(qū)(自己定義)中。源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 STRING DB 10,0,10 DUP(?)DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:D
38、ATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA DX,STRING MOV AH,0AH INT 21H MOV CL,STRING+1 XOR CH,CH MOV BX,DX MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示:3、 將內(nèi)存單元存放的BCD碼25H在顯示器上輸出(即輸出字符25)。源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 DATA DB 25HDATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMEN
39、T ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA BX,DATA MOV AL,BX AND AL,0FH ADD AL,30H MOV BX+2,AL MOV AL,BX AND AL,0F0H MOV CL,4 SHR AL,CL ADD AL,30H MOV BX+1,AL MOV CX,2LPP: MOV AH,2 MOV DL,BX+1 INC BX INT 21H LOOP LPP MOV AH,4CH INT 21HCODES ENDSEND START結(jié)果展示:4、
40、將內(nèi)存單元存放的十進(jìn)制數(shù)25從顯示器上輸出(即輸出字符25)。源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 DATA DB 25DATAS ENDSSTACKS SEGMENT ;此處輸入堆棧段代碼STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX ;此處輸入代碼段代碼 LEA BX,DATA MOV AX,BX MOV DL,0AH DIV DL ADD AL,30H ADD AH,30H MOV BX+1,AL MOV BX+2,AHLPP: MOV AH,2 MOV DL,BX+1 INC BX INT 21H LOOP LPP MOV AH,4CH INT 21HCODES ENDS END START結(jié)果展示:5、 從鍵盤輸入10個個位數(shù)字(09之間的任意數(shù)字),并存儲到數(shù)據(jù)區(qū)INPUT中。源程序:DATAS SEGMENT ;此處輸入數(shù)據(jù)段代碼 INPUT DB 10 DUP(?)DATAS ENDSSTAC
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- Unit 2 Art and Artists Grammar in Use 說課稿 -2023-2024學(xué)年高中英語上外版(2020)必修第三冊
- 2025年滬科新版九年級科學(xué)下冊階段測試試卷含答案
- 2025年房產(chǎn)轉(zhuǎn)讓合同書6篇
- 高中信息技術(shù)粵教版1.1-1.4信息及其特征說課稿
- 2025年北師大新版八年級地理下冊階段測試試卷含答案
- 二零二五年度汽車維修配件批發(fā)合同2篇
- 2025年北師大新版七年級數(shù)學(xué)上冊階段測試試卷含答案
- 2025年人教版PEP八年級物理下冊月考試卷含答案
- 2025年人教版選修6歷史下冊階段測試試卷含答案
- 寵物友好展會寵物友好活動策劃分享考核試卷
- 臨床三基考試題庫(附答案)
- 醫(yī)學(xué)課件三叉神經(jīng)痛3
- 2024年全國職業(yè)院校技能大賽高職組(智能節(jié)水系統(tǒng)設(shè)計與安裝賽項)考試題庫-上(單選題)
- 鷓鴣山隧道瓦斯地段專項施工方案
- HG∕T 2058.1-2016 搪玻璃溫度計套
- 九宮數(shù)獨200題(附答案全)
- 泌尿科一科一品匯報課件
- 國家電網(wǎng)有限公司架空輸電線路帶電作業(yè)工作管理規(guī)定
- 白銅錫電鍍工藝
- 拜耳法氧化鋁生產(chǎn)工藝
- 2024年南京信息職業(yè)技術(shù)學(xué)院高職單招(英語/數(shù)學(xué)/語文)筆試歷年參考題庫含答案解析
評論
0/150
提交評論