Path: vanilla!asbach!noris.net!rednet!msn!news.gtn.com!genesis.westend.com!news.rwth-aachen.de!news.ruhr-uni-bochum.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!blackbush.xlink.net!tank.news.pipex.net!pipex!weld.news.pipex.net!pipex!plug.news.pipex.net!pipex!nielsen.co.uk!peer-news.britain.eu.net!yama.mcc.ac.uk!jumper!simonc From: simonc@jumper.mcc.ac.uk (Simon Cooke) Newsgroups: comp.sys.sinclair Subject: Re: Z80 Interrupts, what do they push? Date: 1 Feb 1996 18:57:38 GMT Organization: Manchester Computing Centre Lines: 40 Message-ID: <4er2f2$qon@yama.mcc.ac.uk> References: <1996Jan29.151529.23999@zippy.dct.ac.uk> X-Newsreader: TIN [version 1.2 PL2] James McKay (com40014@paisley.ac.uk) wrote: : I've been thinking, (since I am getting spurious errors from my work in : progress emulator) that maybe when an interrupt occurs, I should be pushing my : ixflag, iyflag, cbflag and edflag? : If so, then on what condition should they be popped? A reti, retn or even a : normal ret? Sorry to say this, but, erm... you're barking up totally the wrong tree if that's what you've got happening! : The reason this problem occurs is because I consider the 'prefixes' as just 4 : t-state instructions which affect the next instruction, on the next cycle, so : to speak. Is this the wrong approach? I'm afraid it is... Interrupts only occur at the end of an instruction. Prefixes are part of the decode cycle of an instruction, and as such, are treated not as 4-tstate instructions, but as a small part of a larger one. : Also I would like to know if interrupts can occur in the middle of block : instructions as I currently allow it. Yep, it can. Effectively an LDIR, for example is this: Decode ED prefix, PC=PC+1 Decode LDIR instruction (176 ... can't remember the hex), PC=PC+1 (HL)->(DE) INC HL INC DE DEC BC if BC<>0 then PC=PC-2 <> Simon -- +- Email:Simon.Cooke@umist.ac.uk ---- Fidonet: 2:250/124.2 (Simon Cooke) ----+ | Snail:1 Dovey Close, Astley, Tyldesley, Manchester, M29 7NP, UK | | Tel: +44 1942 886084 Fax: +44 1942 886084 (ring voice first to confirm!) | +- WWW: http://jumper.mcc.ac.uk/~simonc -------------------------------------+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Newsgroups: comp.sys.sinclair Subject: Re: Z80 Interrupts, what do they push? Followup-To: comp.sys.sinclair Reply-To: kio@vanilla.nbg.sub.org References: <4er2f2$qon@yama.mcc.ac.uk> Distribution: world Organization: private Keywords: Summary: In article <4er2f2$qon@yama.mcc.ac.uk>, Simon Cooke writes: >: Also I would like to know if interrupts can occur in the middle of block >: instructions as I currently allow it. > >Yep, it can. Effectively an LDIR, for example is this: > >Decode ED prefix, PC=PC+1 >Decode LDIR instruction (176 ... can't remember the hex), PC=PC+1 >(HL)->(DE) >INC HL >INC DE >DEC BC >if BC<>0 then PC=PC-2 ><> Hello Simon, are you sure? Though i agree upon the processing sheme I always thought, that a LDIR/LDDR/INIR/OTIR instruction is an uninterruptable unit. This is, because i remember a frined of mine who built a Z80 based video terminal (long time ago) mentioned, that serial communication was garbaged by LDIR instructions moving 2000 Bytes (scrolling the screen, i suppose) and it worked, when he divided the 2000 byte LDIR into a couple of smaller ones. Maybe *he* was not right or *I* remember things wrong, but i just cannot test it, because the only Z80 system i really possess - my good old ZX Spectrum - is out of working order... So if someone could give an approved answer or test it, i would be very pleased! Thanks ... KIO ! -- My computers work fine with NAND and NOR but refuse work with BILL Gates. Any help appreciated... email: kio@vanilla.nbg.sub.org ftp://lst.informatik.uni-erlangen.de//incoming/kio/readme