1、接口考试实验题字母下落一行的子程序 参考程序清单如下:DSEG SEGMENTROW DB 0COL DB 20CHR DB 41HDELT DB 10DSEG ENDSCSEG SEGMENT ASSUME CS:CSEG,DS:DSEGSTART: MOV AX,DSEG MOV DS,AX MOV AH,0 INT 16H SUB AL,30H MOV DELT,AL MOV CX,25 AGAIN: MOV DH,ROW MOV DL,COL MOV AL,CHR CALL DROP INC ROW CALL DEALY DEC CX JNZ AGAIN MOV AH,4CH INT
2、21HDEALY: MOV BL,DELTDEALY1: MOV DX,0DEALY2: DEC DX JNZ DEALY2 DEC BL JNZ DEALY1 RETDROP PROC NEAR PUSH AX PUSH DX AND DH,DH MOV DX,3D4H MOV AL,10 OUT DX,AL MOV BH,0 MOV AH,2 POP DX PUSH DX DEC DH INT 10H MOV AL,20H MOV AH,0EH INT 10HDROP1: POP DX POP AX MOV AH,02 INT 10H MOV AH,0EH INT 10H RETDROP
3、ENDPCSEG ENDS END START2)显示一个开动的汽车 参考程序清单: DATA_SEG SEGMENT CAR DB 7 DB 52H,70H,0,0 DB 0B1H,70H,0,1 DB 0DBH,7,0,1 DB 0DBH,7,0,1 DB 4FH,7,1,0 DB 4FH,7,0,-3 DB 2,7,-2,1CHAR_CNT DW ?POINTER DW ?LINE_ON DB ?COL_ON DB ?DATA_SEG ENDSCODE_SEG SEGMENT ASSUNME CS:CODE_SEG,DS:DATA_SEGMAIN PROC FAR PUSH DSSUB
4、AX,AXPUSH AXMOV DX,DATA_SEGMOV DS,AXCALL CLEAR_SCREENLEA DI,CARMOV DH,10MOV DL,10CALL MOVE_SHAPE RET MAIN ENDPCLEAR_SCREEN PROC NEARPUSH AXPUSH BXPUSH CXMOV AH,6MOV AL,0MOV CH,0MOV DH,24MOV DL,79MOV BH,7INT 10HPOP DXPOP CXPOP BXPOP AXRETCLEAR_SCREEN ENDPMOVE_SHAPE PROC NEARPUSH AXPUSH BXPUSH CXPUSH
5、DXPUSH DIMOV AH,0FHINT 10HSUB CH,CHMOV CL,DIINC DIMOV CHAR_CNT,CXMOV POINTER,DIMOV LINE_ON,DHMOV COL_ON,DIPLOT_NEXT: ADD AH,DI+2ADD DL,DI+3CMP DI,80JB MOV_CRSRCALL ERASEP0P DIPOP DXPOP CXPOP BXPOP AXRETMOV_CRSR: MOV AH,2INT 10HMOV AL,DI+1PUSH CXMOV CX,1MOV AH,09INT 10HPOP CXADD DI,4LOOP PIOT_NEXTCAL
6、L DLY_QRTRCALL ERASEJMP SHORT PLOT_NEXT MOVE_SHAPE ENDP ERASE PROC MOV CX,CHAR_CNTMOV DI,POINTERMOV DH,LINE_ONMOV DL,COL_ON ERASE_NEXT: ADD DH,DI+2ADD DL,DI+3MOV AH,2INT 10HMOV AL,AIMOV BL,0PUSH CXMOV CX,1MOV AH,9INT 10HPOP CXADD DI,4 LOOP ERASE_NEXTMOV CX,CHAR_CNTMOV DI,POINTERMOV DH,LINE_ONINC COL
7、_ONMOV DL,COL_ONRET ERASE ENDP DLY_QRTR PROC NEARPUSH CXPUSH BXMOV DX,25D11: MOV CX,2801 D12: LOOP D12DEC DXJNZ D11POP DXPOP CXRETDLY_QRTR ENDPCODE_SEG ENDS END MAIN在屏幕中部四处分别显示黑桃、红心、方块和草花 参考程序清单如下:STACK SEGMENT STACKSTACK DW 32 DUP (?)STACK ENDSDATA SEGMENTCDSH DB 5,70H,10,40 DB 4,74H,13,37 DB 6,70H
8、,13,43 DB 3,74H,16,40DATA ENDSCODE SEGMENTBEGIN PROC FAR ASSUME SS:STACK,CS:CODE,DS:DATA PUSH DS SUB AX,AX PUSH AX MOV AX,DATA MOV DS,AX MOV AH,0 MOV AL,3 INT 10H MOV AH,15 INT 10H MOV SI,OFFSET CDSH MOV CX,4AGAIN: PUSH CX MOV AH,2 MOV DH,SI+2 MOV DL,SI+3 INT 10H MOV AH,9 MOV AL,SI MOV BL,SI+1 MOV C
9、X,1 INT 10H ADD SI,4 Pop cx LOOP AGAIN RETBEGIN ENDPCODE ENDS END BEGIN2)在屏幕的左上角显示一排“小人”,白色、红色、绿色、黄色各8个。小人由3个字符组成参考程序清单如下:STACK SEGMENT STACKSTACK DW 32 DUP (?)STACK ENDSDATA SEGMENTDATAB DB 1,7,0,0,1,4,0,8,1,2,0,16,1,14,0,24 DB 4,7,1,0,4,4,1,8,4,2,1,16,4,14,1,24 DB 13H,7,2,0,13H,4,2,8,13H,2,2,16, 1
10、3H,14,2,24DATA ENDS CODE SEGMENT BEGIN PROC FARASSUME SS:STACK,CS:CODE,DS:DATAPUSH DSSUB AX,AXPUSH AXMOV AX,DATAMOV DS,AXMOV AH,0MOV AL,3INT 10HMOV AH,15INT 10HMOV SI,OFFSET DATABMOV CX,3 AGAOT: PUSH CX MOV CX,4 AGAIN: PUSH CXMOV AH,2MOV DH,SI+2MOV DL,SI+3INT 10HMOV AL,SIMOV AH,9MOV BL,SI+1MOV CX,8I
11、NT 10HADD SI,4POP CXLOOP AGAINPOP CXLOOP AGAOTRET BEGIN ENDP CODE ENDSEND BEGIN编制循环发出乐谱声音的 参考程序如下:DSEG SEGMENTDATA DW 262,294,330,349,392,440,494,524DSEG ENDSCSEG SEGMENT ASSUME CS:CSEG,DS:DSEGSTART: MOV AX,DSEG MOV DS,AXAGAIN: MOV SI,OFFSET DATA MOV CL,8LOOP1: CALL SND1 ADD SI,2DEC CLJNZ LOOP1MOV C
12、L,7LOOP2: CALL SND1SUB SI,2DEC CLJNZ LOOP2JMP AGAIN SND1 PROC NEARMOV DX,SIMOV AX,1000MOV BL,3CALL SOUNDMOV AH,01INT 16HJZ SND2MOV AH,0INT 16HCMP AL,1BH JNZ SND2MOV AH,4CHINT 21H SND2: RET SND1 ENDP SOUND PROC NEARPUSH DXPUSH CXPUSH BXPUSH AXMOV CX,DXMOV AL,10110110BOUT 43H,ALMOV DX,0012HMOV AX,34DC
13、HDIV CXOUT 42H,ALMOV AL,AHOUT 42H,ALIN AL,61HMOV BH,ALAND AL,0FCHOR AL,BLOUT 61H,ALPOP AXPUSH AXMOV CX,1000MUL CXMOV CX,DXMOV DX,AXMOV AH,86HINT 15HMOV AL,BHOUT 61H,ALPOP AXPOP BXPOP CXPOP DXRET SOUND ENDP CSEG ENDSEND START2)模拟电话铃声 参考程序清单:CSEG SEGMENT ASSUME CS:CSEG SOUND PROC PUSH CX PUSH SI MOV SI,DX MOV AL,10110110B OUT 43H,AL MOV DX,0012H MOV AX,34DCH DIV SI OUT 42H,AL MOV AL,AH OUT 42H,AL IN AL,61H OR AL,03H OUT 61H,AL POP AX MOV DX,1000 MUL DX MOV CX,DX MOV DX,AX MOV AH,86H INT 15H POP SI POP CX RETSOUND ENDP RING PROC FAR PUSH DS XOR AX,AX PUSH AX MOV BP,8AGAIN: MOV CX,30 NE
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1