Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!rice!uw-beaver!ubc-cs!van-bc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!cmcl2!phri!cooper!gene From: gene@cooper.cooper.EDU (Gene (the Spook) ) Newsgroups: comp.arch Subject: Re: Zilog's mnemonics; a boon to programmers Message-ID: <3073@cooper.cooper.EDU> Date: 17 Nov 90 02:07:14 GMT References: <1990Nov16.050844.12539@hayes.ims.alaska.edu> Organization: The Cooper Union (NY, NY) Lines: 35 in article <1990Nov16.050844.12539@hayes.ims.alaska.edu>, floyd@hayes.ims.alaska.edu (Floyd Davidson) says: > It is also true that some of those instructions that don't exist (in > the books, anyway) do some strange things, some of which were very > useful. It has been too long for me to remember exactly what they > are, but I think 8 bit manipulation of the index registers were the > useful ones. Yup. The ALE editor/assembler for old TRS-80s even supported those instructions! You could do things such as setting the high- or low- byte of the IX and IY registers by specifying the instruction as {HX|LX|HY|LY} when HX is the high byte of the IX register, LX is the low byte of the IX register, HY is the high byte of the IY register, and LY is the low byte of the IY register. Also, you could easily get 2x+1 from a register containing value x by using the SLS (shift left and set) pseudo-instruction. This grew from the fact that there was a shift right arithmetic, shift left arithmetic, and shift right logical, but no shift left logical. The Z80 would shift the quantity x left by one (2x), and set the LSB (+1). Nifty for doing "trick" multiplies. According to every source for the Z80 (as far as I know), all these pseudo-instructions worked just fine, but were neither tested-for nor guaranteed. Also, if I'm not mistaken, the Z[12]80 support similar operations. Play with them and have fun! (BTW, try to get hold of an old 6502 and use the HCF (halt and catch fire) instruction. Loads of laughs. Impress your friends.) Spookfully yours, Gene