8ee ;****************************************** ;* Routine to send a DAYTIME command * ;* to your TNC with the setting of * ;* the real time clock in your PC * ;****************************************** CSEG SEGMENT ASSUME CS:CSEG,DS:CSEG ORG 100h start: jmp begin outstr db 'DAYTIME ' val db 10 dup(0),0Dh ;Space for year,month,day,time and a CR calc PROC NEAR mov al,bl shr al,1 ;We want the high nibble... shr al,1 shr al,1 shr al,1 and al,0fh add al,30h mov byte ptr[bp],al inc bp mov al,bl and al,0fh add al,30h mov byte ptr[bp],al ;Now the low nibble inc bp ret calc ENDP output PROC NEAR mov bp,OFFSET outstr ;Pointer to the daytime string mov si,0 mov dx,02f8H ;COM2 port address mov cx,19 ;19 characters to output loopi: mov al,byte ptr[bp+si] out dx,al ;output character to COM4 port inc si ;and advance SI push dx flush: mov dx,2fdh in al,dx test al,32 ;wait for output buffer to be empty jz flush pop dx loop loopi ;next character ret output ENDP gettime: mov ah,04h ; Read real time clock date int 1Ah mov bp,OFFSET val mov bl,cl ;Year call calc mov bl,dh ;Month call calc mov bl,dl ;Day call calc mov ah,02h ;Read real time clock time int 1Ah mov bl,ch call calc mov bl,cl call calc ret ;======================================================================== begin: call gettime call output ret ;========================================================================= CSEG ENDS END start . 0