On Mon, 14 Aug 95 23:52:59 -0600, [EMAIL PROTECTED] said:
>                                           If you check out the speed of a LD
> A,7 compared to a NOP then you should see that this instruction takes 
> 9.3/4=2.3
> times more time.

OK, on average, in mode 4, if the screen is turned on, then LD A,7 should
take approximately 10.06 T-states.  But it is _actually_ taking either 8
or 16 depending on where it is on the screen.  If the screen is off then
it always takes 8. I think this explanation is more instructive than just
"it takes 10.06 T-states".

I already posted one program that can time instructions; here is another.

begin 644 tstate.bin
M([EMAIL PROTECTED];][;`J_?TBU>HA^\GS([EMAIL PROTECTED],0
[EMAIL PROTECTED]@^P``S0#Z.M?JIR``/@0."-/[EMAIL 
PROTECTED]/X-(/.OT_[!K]O^+^8?(`T-
>(,LZU^KN`3+7ZAB_\RK5ZB+]_>U6/C_M1_O)````
`
end

Load it in at 60000 and POKE 64000,201 (important!).  Print some markers
on the top line of the screen (for example, a sequence of digits) and then
PAUSE 10:CALL 60000.  What you should see is some coloured stripes just
above the markers and a vertical line aligned with the left-hand side of
the screen.  Press a key (any key that is on port 254) to stop it.

All you have to do is poke some instructions in at 64000, ending with RET,
and the CPU meter will tell you how long they took, not including the RET.
Each character square moved by the meter is 8 T-states, and if the meter
oscillates between two positions then the true result is half way between
the two.  Note that the instructions you poke in will be executed on an
8-cycle boundary in such a way that both IN A,(254) and NOP:IN A,(254)
take 24 cycles.

Both the programs measure the instructions with the screen off, but the one
in BASIC can be changed (with difficulty) to leave the screen on.  This one
can't.

It should be quite easy to make a complete table of instruction timings, if
that is particularly desired.  I find my logical explanation cam predict the
result in most cases, however.

> Still on the insult line, I don't see why I should get a slam for "recently"
> mentioning the sigma/entropy logo thing - since the last I talked of it was
> with Andrew at the Gloucester show (some 4 months ago!).

He probably wrote the text some time ago, and anyway I don't think your
name is mentioned in connection with this.  He just got a bit cheesed off
with people mentioning it.

imc

Reply via email to