Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: nyu notesfiles V1.1 4/1/84; site ur-univax.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rochester!ur-univax!pier From: pier@ur-univax.UUCP Newsgroups: net.micro.pc Subject: Re: UNIX-like date command wanted for IB Message-ID: <1200025@ur-univax.UUCP> Date: Thu, 30-May-85 15:11:00 EDT Article-I.D.: ur-univa.1200025 Posted: Thu May 30 15:11:00 1985 Date-Received: Sat, 1-Jun-85 12:34:36 EDT References: <710@pyuxqq.UUCP> Organization: University of Rochester: Computing Center Lines: 52 Nf-ID: #R:pyuxqq:-71000:ur-univax:1200025:000:1527 Nf-From: ur-univax!pier May 30 15:11:00 1985 The following is a set of 2 Pascal procedures written in Turbo Pascal that get the date and time. I hope you have Turbo Pascal though. If you don't have it you can always figure out what these Pascal procedures do and write them in assembler. The intr procedure is the interrupt procedure built in Turbo. It is used here to call the DOS function (int 21H) with the function number in register AH. Hope this is of use. ------------------------------------------------------------------------------- type datetimetype = string[8]; regtype = record ax,bx,cx,dx,bp,si,di,ds,es,flags: integer; end; function date :datetimetype; var reg :regtype; y,m,d,w :datetimetype; i :integer; begin reg.ax:=$2A00; intr($21,reg); str(reg.cx,y); delete(y,1,2); str(hi(reg.dx):2,m); str(lo(reg.dx):2,d); w:=m+'/'+d+'/'+y; for i:=1 to length(w) do if w[i] = ' ' then w[i]:='0'; date:=w; end; function time :datetimetype; var reg :regtype; h,m,s,w :datetimetype; i :integer; begin reg.ax:=$2C00; intr($21,reg); str(hi(reg.cx):2,h); str(lo(reg.cx):2,m); str(hi(reg.dx):2,s); w:=h+':'+m+':'+s; for i:=1 to length(w) do if w[i] = ' ' then w[i]:='0'; time:=w; end; ------------------------------------------------------------------------------- Pierre Darmon University of Rochester