Post Reply 
NOP on HP-41C
12-28-2020, 08:59 PM
Post: #21
RE: NOP on HP-41C
(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).
Visit this user's website Find all posts by this user
Quote this message in a reply
12-28-2020, 10:33 PM (This post was last modified: 12-28-2020 10:40 PM by hth.)
Post: #22
RE: NOP on HP-41C
(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.
Find all posts by this user
Quote this message in a reply
12-29-2020, 01:57 AM
Post: #23
RE: NOP on HP-41C
(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.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-29-2020, 02:31 AM
Post: #24
RE: NOP on HP-41C
(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
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 4 Guest(s)