[comp.sys.handhelds] Assembly questions for HP48

grue@batserver.cs.uq.oz.au (Frobozz) (12/21/90)

hiya,
	I've got a quick request for information about the execution speeds
of various instructions on the saturn processor.

Which of the following two pieces of code will run more quickly?
	clr.a	c
	move.p2	10, c
or
	move.p5	10, c

The first is shorter by one nibble than the second.

Also what happens if we change the field in the first code section to .p1
or .p3 ??


I'm asking mostly out of interests sake, and I could write a program to
determine the result.  I was wondering if anybody out there has some timing
details for the chip.



							Pauli
seeya

Paul Dale               | Internet/CSnet:            grue@batserver.cs.uq.oz.au
Dept of Computer Science| Bitnet:       grue%batserver.cs.uq.oz.au@uunet.uu.net
Uni of Qld              | JANET:           grue%batserver.cs.uq.oz.au@uk.ac.ukc
Australia, 4072         | EAN:                          grue@batserver.cs.uq.oz
                        | UUCP:           uunet!munnari!batserver.cs.uq.oz!grue
f4e6g4Qh4++             | JUNET:                     grue@batserver.cs.uq.oz.au
--

akcs.joehorn@hpcvbbs.UUCP (Joseph K. Horn) (12/26/90)

Paul Dale (grue) asks:

> Which of the following two pieces of code will run more quickly?
>   clr.a   c
>   move.p2 10, c
> or
>   move.p5 10, c
> 
> The first is shorter by one nibble than the second.
> 
> Also what happens if we change the field in the first code section
> to .p1 or .p3 ??

Unfortunately, your question is in Alonzo mnemonics, and the answer
is found in the HP-71 IDS Volume 1, which is in HP mnemonics, so I
had to "translate" your question before I could answer it...

"clr.a c" is "C=0 A" (Clear C, address field), whose opcode is D2.
This instruction executes in 7 clock cycles.  "move.p2 10,c" is
"LCHEX 10" (Load C with hex 10 starting at the P pointer position),
whose opcode is 3101.  This instruction executes in 5 clock cycles.
Therefore these two instructions take 12 cycles together.

"move.p5 10,c" is "LCHEX 00010", opcode 3401000.  This instruction
executes in 8 clock cycles, and is therefore one nib longer but much
faster than the other two together.

To answer you second question, the execution times of "move.pn hh,c"
instructions, where n is the number of hex digits (hh) to move into
register C, is n+3 cycles.

--  Joseph K. Horn  --  (714) 858-0920  --  Peripheral Vision, Ltd.