一个显示系统时间的程序
程序代码:
DATAS SEGMENT BUF1 DB'THE TIME IS NOW:$' BUF2 DB 10 DB 10 DUP(?) BUF3 DB 'CLASS:XINGONG04201 $' BUF4 DB 'NAME:MA liNA $' BUF5 DB '^^^^^^^ ^^^^^^^ $' BUF6 DB ' ~~~ ~~~ $' BUF7 DB ' 00 >o o < 00 $' BUF8 DB ' 00 (::) 00 $' BUF9 DB ' 00 ~ ~ 00 $' BUF10 DB ' 00 !00 $' DATAS ENDS STACKS SEGMENT DB 100 DUP(?) STACKS ENDS CODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKS CURSOR MACRO ROW,CLM MOV AH,2 MOV BH,0 MOV DH,ROW MOV DL,CLM INT 10H ENDM WIN MACRO ROWL,CLML,ROWR,CLMR,COLOR MOV AH,6 MOV AL,0 MOV CH,ROWL MOV CL,CLML MOV DH,ROWR MOV DL,CLMR MOV BH,COLOR INT 10H ENDM ASCBCD MACRO REG MOV al,REG mov ah,0 mov REG,0 mov bh,10 div bh mov REG,ah push cx MOV CL,4 SHL al,CL pop cx add REG,al ENDM BCDASC MACRO REG INC BX INC BX MOV AL,REG push cx MOV CL,4 SHR AL,CL pop cx OR AL,30H MOV [BX],AL INC BX MOV AL,REG AND AL,0FH OR AL,30H MOV [BX],AL ENDM INCBCD MACRO REG,COUNT MOV AL,REG INC AL DAA MOV REG,AL CMP AL,COUNT JNZ DISPY MOV REG,0 ENDM STRDSPY MACRO ADRS LEA DX,ADRS MOV AH,9 INT 21H ENDM CLOCK PROC FAR START: PUSH DS MOV AX,0 PUSH AX MOV AX,DATAS MOV DS,AX WIN 0,0,24,79,7 WIN 6,9,18,70,01000001B CURSOR 6,25 STRDSPY BUF5 CURSOR 7,25 STRDSPY BUF6 CURSOR 8,25 STRDSPY BUF7 CURSOR 9,25 STRDSPY BUF8 CURSOR 10,25 STRDSPY BUF9 CURSOR 11,25 STRDSPY BUF10 CURSOR 6,9 STRDSPY BUF3 CURSOR 7,9 STRDSPY BUF4 CURSOR 14,32 STRDSPY BUF1 CURSOR 15,36 MOV AH,2cH INT 21H ASCBCD CH ASCBCD CL ASCBCD DH TIMER: CALL DELY INCBCD DH,60H INCBCD CL,60H INCBCD CH,24H DISPY: LEA BX,BUF2 BCDASC CH BCDASC CL BCDASC DH INC BX MOV AL,'$' MOV [BX],AL PUSH DX CURSOR 15,36 STRDSPY BUF2+2 POP DX MOV AH,01H INT 16H CMP AL,1BH JZ X XOR AL,AL JMP TIMER X:MOV AH,4CH INT 21H RET DELY PROC PUSH CX PUSH AX push bx mov bx,4 x3:MOV AX,9000 X1:MOV CX,0FFFFH X2:DEC CX JNE X2 DEC AX JNE X1 dec bx jne x3 pop bx POP AX POP CX RET DELY ENDP CLOCK ENDP CODES ENDS END START
[此贴子已经被作者于2016-6-5 10:58编辑过]