Re: A86: Re: Timings


[Prev][Next][Index][Thread]

Re: A86: Re: Timings




You also need to remember that your program doesn't get to use all 6 mil cycles
unless you disable interrupts - the 'software' interrupt runs approx. 174 times
per second (or so I've heard).  The easiest way to count off a second,
therefore, is probably to install a user interrupt that counts down from 174:

seconds:
 .db 0

.org _user_int_ram
user_int:
 push af
 ld a,(counter)
 dec a
 jr nz,notyet
 ld a,{seconds)
 inc a
 ld (seconds),a
 ld a,174
notyet:
 ld (counter),a
 pop af
 ret
counter:
 .db 174
.end

David Phillips wrote:

> The Z80 in the 86 runs at 6Mhz, or 6,000,000 clock cycles per second.  An
> instruction is measured in t-states, or time states.  A 4 t-state
> instruction, such as NOP, would execute 1.5 million times in a second
> (though I have heard this is not exact, can anyone confirm?).

--
Dark Ryder
ICQ#:     8189903
E-Mail:   DarkRyder@cyberdude.com

Happiness is inversely proportional to how much you want to upgrade your
computer.

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/CC/ED/IT/M/MU/P/S/O/AT (!)d-? s++(+):+(++) a?--- C++++$
UB>L+++ P L>+++ E- W+++$ !N o? K- w(---)$ !O M(+)(-) V?
PS+(+++) PE-- Y PGP++ t*+(+++) 5++ X+ R*+++ tv b+++ DI++++
D++ G++>++++ e*>+++++ h!>++ r-(+) y**++
------END GEEK CODE BLOCK------



Follow-Ups: References: