HP Forums
NOP on HP-41C - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: NOP on HP-41C (/thread-15933.html)

Pages: 1 2


RE: NOP on HP-41C - Dave Britten - 12-28-2020 08:59 PM

(12-28-2020 08:37 PM)Sylvain Cote Wrote:  
(12-28-2020 06:51 PM)hth Wrote:  Each move of the goose costs 15 cycles extra compared to if a message is shown.

(12-28-2020 08:15 PM)Dave Britten Wrote:  Interesting, what does that translate to in microseconds? (Assuming a perfectly calibrated CPU clock, of course.)

In the old HP 41 CPU speed thread John Ioannidis says the HP-41 process 6300 machine instructions per second or 1 instruction per 158.730 microseconds.
So assuming that this is a good estimation and that all instructions take the same amount of time to execute, which I doubt, the goose move subroutine (15 cycles) would takes 2.381 milliseconds to execute.

That's pretty close to what I measured, which was about 4 ms. There could be other factors in play that made my program with the message a bit slower - isn't there a slight amount of overhead when program execution crosses a register boundary, or am I thinking of a different calculator? Maybe my program with the "WAIT" message added wasn't aligned as neatly (yes, I PACKed the program, and SSTed over the GTO 00 to compile it first).


RE: NOP on HP-41C - hth - 12-28-2020 10:33 PM

(12-28-2020 08:59 PM)Dave Britten Wrote:  That's pretty close to what I measured, which was about 4 ms. There could be other factors in play that made my program with the message a bit slower - isn't there a slight amount of overhead when program execution crosses a register boundary, or am I thinking of a different calculator? Maybe my program with the "WAIT" message added wasn't aligned as neatly (yes, I PACKed the program, and SSTed over the GTO 00 to compile it first).

That is correct, there program speed may vary slightly due to the position of the bytes inside registers. Not strange if you think about it, it needs to fetch a register and then align the bytes to the same position for execution dispatch. You should not modify the program before the loop, call a subroutine located after the loop where you make any changes.


RE: NOP on HP-41C - Dave Britten - 12-29-2020 01:57 AM

(12-28-2020 10:33 PM)hth Wrote:  
(12-28-2020 08:59 PM)Dave Britten Wrote:  That's pretty close to what I measured, which was about 4 ms. There could be other factors in play that made my program with the message a bit slower - isn't there a slight amount of overhead when program execution crosses a register boundary, or am I thinking of a different calculator? Maybe my program with the "WAIT" message added wasn't aligned as neatly (yes, I PACKed the program, and SSTed over the GTO 00 to compile it first).

That is correct, there program speed may vary slightly due to the position of the bytes inside registers. Not strange if you think about it, it needs to fetch a register and then align the bytes to the same position for execution dispatch. You should not modify the program before the loop, call a subroutine located after the loop where you make any changes.

That's a good idea, maybe I'll try that tomorrow just for kicks to see the difference. The core of the routine is just TIME, LBL 00, DSE 00, GTO 00, TIME.


RE: NOP on HP-41C - Paul Dale - 12-29-2020 02:31 AM

(12-29-2020 01:57 AM)Dave Britten Wrote:  The core of the routine is just TIME, LBL 00, DSE 00, GTO 00, TIME.

One implication of position within register altering timing is that the empty reference loop will have different timing to a non-empty loop due to instruction movement.


Pauli