6c4 clock MACRO LOCAL tmval_str,calc,out_time,over_data,oldcol,oldrow push ax ;Save registers on stack push bx push cx push dx push bp push si mov ah,02H ;Read real time clock time int 1aH mov bp,OFFSET tmval_str mov si,0 mov bl,ch call calc mov bl,cl call calc jmp out_time ;Write time to screen calc: 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+si],al ;first character inc si mov al,bl and al,0fh add al,030h mov byte ptr [bp+si],al ;second character inc si inc si ;skip over the ':' ret out_time: mov ah,0fh int 10h mov ah,03h int 10h mov oldcol,dl ;Save old cursor position mov oldrow,dh mov dl,75 ;Place cursor in upper right corner mov dh,0 mov ah,02h int 10h mov ah,09H ;Write time to screen mov dx,OFFSET tmval_str int 21H mov dl,oldcol ;Restore old cursor position mov dh,oldrow mov ah,02 int 10h pop si ;Restore registers pop bp pop dx pop cx pop bx pop ax jmp Over_data oldcol db 0 oldrow db 0 tmval_str db 2 dup (0),':',2 dup (0),'$' Over_data: ENDM . 0