Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hp-pcd!hpcvra.cv.hp.com!rnews!hpcvbbs!akcs.joehorn From: akcs.joehorn@hpcvbbs.UUCP (Joseph K. Horn) Newsgroups: comp.sys.handhelds Subject: Re: Assembly questions for HP48 Message-ID: <2777de06:1489.1comp.sys.handhelds;1@hpcvbbs.UUCP> Date: 25 Dec 90 23:40:04 GMT References: <6488@uqcspe.cs.uq.oz.au> Lines: 31 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.