I said...
> Well I shall have to do some experimenting on that front.  Presumably it
> depends whether the screen is on or not and whether the routine is in
> ROM?

It turns out that even if the screen is off then the ASIC does something
silly like restricting memory access to 1 every 4 T-states so that the
number of cycles for most instructions is ((x+3) BAND &FC) where x is
the number of cycles you would expect.  However certain memory (or I/O)
-intensive instructions take 4 cycles longer than that.  Examples are:

  PUSH rr     16
  IN A,(254)  16
  OUT (254),A 16
  INI/OUTI    20
  INIR/OTIR   28 (if BC>0)
  LDI         20, unless DE points to the ROM in which case 16
  LDIR        24 (if BC>0)

Fortunately, machine code in the ROM seems to run at the correct speed as
long as it doesn't try to access any memory.  Maybe this is what Bob meant
when he said that a special ROM is required; programs in RAM don't seem to
run very fast, which is quite important with a hard drive.

Simon Cooke said...

> Actually, there's a good reason for it...

> 1) The ASIC does that so that it can keep up with refreshing the whole 512k
> of memory properly, and

So how come the Spectrum manages to refresh 128K of memory without all this
hassle then?

> 2) So that it can show the screen with as little video contention as
> possible..

But it isn't showing the screen so why does that matter?

Incidentally it is very irksome that whoever designed the Sam did not
think to put even a small amount of non-contended RAM in for critical
routines.  For example, the memory in the 512K machine is physically
located in at least two places and the display can only be taken from
one of them at a time, so why isn't the other bank (whichever one does
not contain the display) non-contended?

imc

Reply via email to