Metropoli BBS
VIEWER: time.asm MODE: TEXT (ASCII)
;funcs from TIME.H

include qlib.inc
include time.inc
include dos.inc

.code
_time proc,a:dword
  local now:dword   ;time struct

  pushad
  mov     ebx,a
  lea     eax,now
  callp   gettime,eax
  xor     edx,edx
  mov     dl,[now].time.ti_hour
  imul    eax,edx,3600
  xor     edx,edx
  mov     dl,[now].time.ti_min
  imul    ecx,edx,60
  add     eax,ecx
  xor     edx,edx
  mov     dl,[now].time.ti_sec
  add     eax,edx
  test    ebx,ebx
  jz      short _L1
  mov     [ebx],eax
_L1:
  mov [esp].callstruct._eax,eax
  popad
  ret     
_time endp

clock proc   ;returns time since program started
  local now:dword  ;time struct

  pushad
  lea     eax,now
  callp   gettime,eax
  xor     edx,edx
  mov     dl,[now].time.ti_hund
  imul    eax,edx,10
  xor     edx,edx
  mov     dl,[now].time.ti_hour
  imul    ecx,edx,3600
  xor     edx,edx
  mov     dl,[now].time.ti_min
  imul    edx,60
  add     ecx,edx
  xor     edx,edx
  mov     dl,[now].time.ti_sec
  add     ecx,edx
  imul    ecx,1000
  add     eax,ecx
  mov [esp].callstruct._eax,eax
  popad
  ret     
clock endp

end

[ RETURN TO DIRECTORY ]