LOOPR: MOV AH,2CH INT 2CH
TIMER1 CH,YEAR1 TIMER1 CL,YEAR2 TIMER1 DH,MOUTH TIMER1 DL,DAY TIMER1 AL,WEEK CURSOR 5,15
MOV DX,OFFSET BUF1 MOV AH,09H INT 21H
STRDSPY YEAR1 STRDSPY YEAR2
MOV DX,OFFSET BUF2 MOV AH,09H INT 21H
STRDSPY MOUTH MOV DX,OFFSET BUF3 MOV AH,09H INT 21H
STRDSPY DAY MOV DX,OFFSET BUF4 MOV AH,09H INT 21H
MOV DX,OFFSET BUF5 MOV AH,09H INT 21H
STRDSPY WEEK
MOV AH,0BH INT 21H CMP AL,00H JNZ EXITT JMP LOOPR
EXITT: SETCRT CLEAR
MOV AH,4CH INT 21H
CODE ENDS
END START DATA SEGMENT
BUF1 DB \ BUF2 DB \ BUF3 DB \ BUF4 DB \ BUF5 DB \
YEAR1 DB 20H,20H,'$' YEAR2 DB 20H,20H,'$'
MOUTH DB 20H,20H,'$' DAY DB 20H,20H,'$' WEEK DB 20H,20H,'$'
INFOR DB \DATA ENDS
STACK SEGMENT STACK SNUM DW 20H DUP(?) STACK ENDS CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK START:
MOV AX,DATA MOV DS,AX MOV AX,STACK MOV SS,AX
MOV AX,LENGTH SNUM MOV SP,AX
SETCRT MACRO MOV AH,0 MOV AL,2 INT 10H ENDM
CLEAR MACRO
MOV AH,06H MOV AL,0 INT 10H ENDM
CURSOR MACRO ROW,CLM MOV AH,02H MOV BH,00H MOV DH,ROW MOV DL,CLM INT 10H ENDM
STRDSPY MACRO STRING PUSH DX PUSH AX
MOV DX,OFFSET STRING MOV AH,09H INT 21H POP AX POP DX ENDM
TIMER1 MACRO REG,ADR
PUSH AX PUSH BX LEA SI,ADR MOV AL,REG MOV AH,00 MOV BL,10 DIV BL
ADD AL,30H MOV [SI],AL ADD AH,30H INC SI
MOV [SI],AH POP BX POP AX ENDM SETCRT
CLEAR CURSOR 7,23 STRDSPY INFOR
LOOPR: MOV AH,2CH INT 2CH
TIMER1 CH,YEAR1 TIMER1 CL,YEAR2 TIMER1 DH,MOUTH TIMER1 DL,DAY TIMER1 AL,WEEK CURSOR 5,15
MOV DX,OFFSET BUF1 MOV AH,09H INT 21H
STRDSPY YEAR1 STRDSPY YEAR2
MOV DX,OFFSET BUF2 MOV AH,09H INT 21H
STRDSPY MOUTH MOV DX,OFFSET BUF3 MOV AH,09H INT 21H
STRDSPY DAY MOV DX,OFFSET BUF4 MOV AH,09H INT 21H
MOV DX,OFFSET BUF5 MOV AH,09H INT 21H
STRDSPY WEEK
MOV AH,0BH INT 21H CMP AL,00H JNZ EXITT JMP LOOPR
EXITT: SETCRT CLEAR
MOV AH,4CH INT 21H
CODE ENDS
END START
3、总结
通过这次试验,让我加深了对汇编语言的学习,虽然程序出来的方式是通过照猫画虎的,但还是对汇编有了一定的了解了。