Path: seq!spell
From: Poul-Henning Kamp <phk@data.fls.dk>
Subject:  v02i011:  timeeval - "Stopwatch" EVAL v1.0, Part01/01
Newsgroups: comp.sources.hp48
Followup-To: comp.sys.hp48
Approved: spell@seq.uncwil.edu

Checksum:  227788406 (verify with brik -cv)
Submitted-by: Poul-Henning Kamp <phk@data.fls.dk>
Posting-number: Volume 2, Issue 11
Archive-name: timeeval/part01


BEGIN_SRC timeeval.s
* TIMEEVAL          Size: 77.5 bytes,  Checksum: #A2C7h
* ========
*
* Source for RPLCOMP & friends...
*
* by phk@data.fls.dk 26oct91
*
* obj -> TIMEEVAL n(ticks) x_ms
*
* Evaluates the object on top of the stack, and returns the time it took in
* ticks of the internal clock and in milli-seconds.
*
* Arguments for <obj> can put put on the stack above it, and results from the
* evaluation will be available above the results of TIMEEVAL.
*
* example:
*          +----------------------+                  +----------------------+
*          |4:                    |                  |4:                    |
*          |3:                    |                  |3:       .908508177527|
*          |2:                65.3|                  |2:                 247|
*          |1:                 SIN|  -> TIMEEVAL ->  |1:           30.151_ms|
*          +----------------------+                  +----------------------+
*
*
* You cannot get SIN onto the stack ?  try this: { SIN } OBJ\-> DROP
*
* The T0 offset is (on my calc, Rev E) 31 ticks, or 3.784_ms.  This is roughly
* the time it takes to evaluate a data-object like "Hello".
*
* WARNINGS:
* =========
*
* The EVAL employed is the "kernel-one", which does not evalute inside lists.
*
* Programs relying on a specific local-env will fail if they use 1GETLAM &c &c.
*
* There is no ERRTRAP built in.
*
ASSEMBLE
	NIBASC /HPHP48-Z/
RPL
::                    ( 02d9d )
  CK1NOLASTWD         ( 18ab2 )
  ZERO                ( 03fef )
  1LAMBIND            ( 634cf )
  GARBAGE             ( 05f42 )
  CLKTICKS            ( 0eb81 )
  1PUTLAM             ( 615e0 )
  EVAL                ( 06f8e )
  CLKTICKS            ( 0eb81 )
  1GETABND            ( 634b6 )
  bit-                ( 53eb0 )
  #>%                 ( 5435d )
  DUP                 ( 03188 )
  % 8.192             ( 02933 0819200000000000 )
  %/                  ( 2a9fe )
  %3                  ( 2a2f3 )
  RNDXY               ( 2b529 )
  DOEXT               ( 02ada )
    %1                ( 2a2c9 )
    CHR "m"           ( 029bf 6d )
    $ "s"             ( 02a2c 00007 73 )
    umP               ( 10b7c )
    umEND             ( 10b86 )
    SEMI              ( 0312b )
  UM>U                ( 0f33a )
  ;                   ( 0312b )
END_SRC

BEGIN_ASC timeeval.asc
%%HP: T(1)A(D)F(.);
"D9D202BA81FEF30FC43624F5018BE00E516E8F6018BE06B4360BE35D53458813
0339200000000000029180EF9A23F2A2925B2ADA209C2A2FB920D6C2A2070000
37C7B0168B01B2130A33F0B21307C2A"
END_ASC

BYTES: #A2C7h 90

BEGIN_UU timeeval.uue
begin 644 timeeval.bin
M2%!(4#0X+5J=+2"K&.\_\$QC0E\0N`[@%>;X!H'K8$MCL#[5-52(,3"3`@``
I````(!D(_JDR+RHIM:*M`LFB\IL";2PJ<```<WP+8;@0*S&@,P\K,0"3
`
end
END_UU

-- 
phk@data.fls.dk		  ||  A host is a host from coast to coast,
Poul-Henning Kamp	  ||  & no one will talk to a host that's close,
FLS DATA A/S		  ||  Unless the host (that isn't close)
Phone: (+45) 36 18 12 35  ||  is busy, hung or dead.
Fax:   (+45) 36 18 12 18  || 				Anon (?) 

