>       So I am wondering what I am meant to be doing about the break
>button? It is
>clearly not just shift+space as on the ZX Spectrum, and pressing it causes my
>code to crash horribly. Is it forcing some sort of RST related interrupt?
>
>               -Thomas

The break button is linked to a pin on the Z80 called NMI, the non-maskable
interrupt. When you press it, the processor calls &66 (102 d).

You can either ignore it totally (put RETN at that location), do something
magic yourself, or break back to the ROM:

100: OUT (LMPR),a
102: LD a,31
     JR 100


Note that the Sam's break button is bouncy, ie that the address will be
called many many times. If you don't deal with it very quickly, the stack
will fill up. I think an unmodified button will send about 3000 interrupts
to the processor (but this probably varies between Sams and depends on the
age of the circuitry).

Andrew



--
 --  Andrew Collier  ([EMAIL PROTECTED])  --        My other
  --      http://mnemotech.ucam.org      --       .sig is a
   -- Part 3 Materials Science, Cambridge --      PDF file
                                           --


Reply via email to