From: kirkland@ee.utah.edu (Dan Kirkland)
Newsgroups: comp.sys.hp48
Subject: timing on hp48
Date: 9 Sep 1996 21:56:51 -0600
Organization: Univ of Utah Electrical Engineering Dept

A couple of notes to those doing programming timings on
the hp48.

Much of the time code on the hp48 will have different
runtimes depending if the code starts on even or odd
addresses.

I am not sure how much this affects RPL code, but it
can affect assembly code quite a bit.  Many assembly
instructions (all with odd number of nibble opcodes?)
take one cpu cycle longer when opcode starts at odd
nibble than it does when opcode starts at even nibble.

Also, the data reading and writing instructions can
vary depending where the data being read (or written)
is located.  In fact, the data reading instructions
(like "A=DAT1) not only vary with odd/even addresses,
but they vary with RAM/ROM addresses!

A method I have used for some time for timing code...
Create two variables in the HOME directory (the
variables need the be the first two in HOME).  Store
a real number (like 0) in the first variable.  Store
the program (or code) to be timed in the second
variable.  Recall the program (or code) from the second
variable and time.  Then store a user binary (like # 0h)
in the first variable replacing the real number.  Then
recall the program (or code) from the second variable
and time again.

A real number is 10.5 bytes, a user binary is 13 bytes,
replacing the real number in the first variable with a
user binary moves the object in the second variable from
even (or odd) to odd (or even) address.

Yes, I can hear it now...

"YOU MEAN I LOST THE PROGRAMMING CONTEST BECAUSE THE
PERSON TESTING THE PROGRAMS STORED MY PROGRAM ON THE
WRONG NIBBLE?!?"

Could be..., could be...

dan
