river_9x 0 Newbie Poster
;----------------------------------------
;            Set System Date             |
;----------------------------------------
INCLUDE lib1.asm
.MODEL small
.STACK 100h
.DATA
 setdate db 13,10,'Enter newdate: $'
 gc db '/ $'
.CODE
PS:
        mov ax,@data
        mov ds,ax
        clrscr
        HienString setdate
        call VAO_2_SO
        mov dl,al
        HienString gc
        call VAO_2_SO
        mov dh,al
        HienString gc
        call VAO_SO_N
        mov cx,ax
        xor dl,dl
        mov ah,2bh
        int 21h
        mov ah,4ch
        int 21h
 VAO_2_SO        PROC
        push bx cx
        mov bl,10
        mov ah,1
        int 21h
        sub al,30h
        mul bl         
        mov cl,al
        mov ah,1
        int 21h
        sub al,30h
        add al,cl
        pop cx bx
        ret
 VAO_2_SO ENDP
HienString MACRO xau
	push AX DX
	mov  DX,offset xau	 
	mov  AH,9		
	int  21h		
	pop  DX AX
	ENDM
CLRSCR MACRO
	push AX
	mov  AH,0fh		 
	int  10h		
	mov  AH,0	
	int  10h		
	pop  AX
	ENDM
VAO_SO_N PROC
	push BX CX DX SI
	mov  BX,10	
	xor  CX,CX	
	mov  SI,CX	
   VSN1:
	mov  AH,1	
	int  21h
	cmp  AL,0dh	
	je   VSN3
	cmp  AL,'-'	
	jne  VSN2	
	inc  SI		
	jmp  VSN1
    VSN2:
	sub  AL,30h	
	xor  AH,AH	
	xchg AX,CX	
	mul  BX		
	add  CX,AX	
	jmp  VSN1
   VSN3:
	and  SI,SI	
	jz   VSN4	
	neg  CX		
   VSN4:
	mov  AX,CX
	pop  SI DX CX BX
	ret
VAO_SO_N ENDP
INCLUDE lib2.asm
        END PS

Thank you very much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.