Re: A86: Hooking interrupt idea


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

Re: A86: Hooking interrupt idea



Jeff Tyrrill wrote:
> 
> I don't think the processor is executing instructions. The
> 200-times-per-second interrupts are disabled, and the processor is stuck on
> a HALT instruction until ON is pressed. The HALT state puts the processor
> into a low power mode.

To shutdown the calc on the 85 (should be similiar on the 86) you
execute

 ld a,1
 out (3),a
 xor a
 out (4),a
 halt
 ld a,22
 out (4),a
 rra
 out (3),a

(hmm no DI/EI... strange...)

The out instructions probably enters/leaves low power mode. And from
Programming the Z80:

-- cut --

HALT   Halt CPU

Function: CPU suspended

Format: [01110110] 76

Description: CPU suspends operation and executes NOP's so as to
             continue memory refresh cycles, until interrupt or
             reset is received.

Timing: 1 M cycle; 4 T states; 2 usec @ 2 MHz + indefinite Nop's.

Addressing Mode: Implicit

Flags: (no effect)

-- cut --

It should be easy to make a program to detect if NOP's are executed
or not:

<out instructions>
ld a,r
ld b,a
halt
ld a,r
<out instructions>

If |a-b|>10 (or something), NOPs have been executed during the HALT
instruction.


-- 
Jimmy Mårdell                "The nice thing about standards is that 
mailto:mja@algonet.se         there are so many of them to choose from."
http://www.algonet.se/~mja    
IRC: Yarin                   "Sanity? I'm sure I have it on tape
somewhere!"


References: