北邮微机原理软件实验报告(精) 下载本文

CMP AL,[DI-4] JA GOON1 JB GOON3 INC DI MOV AL,[DI] CMP AL,[DI-4] PUSHF DEC DI POPF JA GOON1 JBE GOON3 GOON1: MOV BL,-1 PUSH CX MOV CX,4 DEC DI DEC DI

GOON2: MOV AL,[DI] XCHG AL,[DI-4] MOV [DI],AL

INC DI LOOP GOON2 POP CX DEC DI DEC DI GOON3: DEC DI DEC DI DEC DI DEC DI LOOP AGAN CMP BL,0 JNZ COMP2 DEC DI DEC DI MOV CX,VAR1 MOV BH,30H MOV BL,31H RET COM ENDP

DISPY PROC ;送显子程序 DISPY1: MOV DL,BH

MOV AH,02H ;调用DOS 02号功能,显示DL字符(学号 INT 21H MOV DL,BL MOV AH,02H INT 21H

MOV DL,' ' ;调用DOS 02号功能,显示DL字符(空格 MOV AH,02H INT 21H INT 21H INT 21H MOV DL,[DI]

MOV AH,02H ;调用DOS 02号功能,显示DL字符(排名 INT 21H INC DI MOV DL,[DI] MOV AH,02H INT 21H

INC DI MOV DL,' '

MOV AH,02H;调用DOS 02号功能,显示DL字符(空格 INT 21H INT 21H INT 21H MOV DL,[DI] MOV AH,02H INT 21H INC DI MOV DL,[DI]

MOV AH,02H ;调用DOS 02号功能,显示DL字符(成绩 INT 21H INC DI MOV DL,0DH MOV AH,02H INT 21H MOV DL,0AH MOV AH,02H

INT 21H CMP BL,39H JZ L3 INC BL JMP NEXT2 L3: MOV BL,30H INC BH

NEXT2: LOOP DISPY1 ;循环显示 RET DISPY ENDP CODE ENDS END START 五.运行结果