Re: LZ: NEW Z80 INSTRUCTION FOUND!!


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

Re: LZ: NEW Z80 INSTRUCTION FOUND!!



There are a lot of undocumented Z80 opcodes.  At least there were.
They worked in all the Zilog made Z80's but I understand the TI's
use an Hitatchi made Z80, so who knows if they'll work in it.


I used to have a list of them but I haven't seen it for a few years.
I'll look around and see if I can come up with it.


You do realize the risk in using them, don't you?  If TI decides to
change their supplier, they may not work in ones built from that
time on.


Barry


On Thu, 26 Sep 1996, Jimmy Mardell wrote:


> I call it new since it doesn't work on all Z80 models, and it's not in
> tasm80.tab, but it works! The instruction is called SLS and works like SLA
> except that instead of putting a 0 at bit 0, 1 is put there instead. So
> SLL A will do A=A*2+1. I don't know when it could be useful (you'll save
> some byte in some programs I guess) though.
> 
> I checked the emulator source, where it's called SLL (Shift Left Logically
> I guess, but I can't see why it's logical...) so I don't know if it should
> be SLS or SLL.
> 
> I found it when I read an old Z80 paper (swedish), and I'll translate that
> part:
> 
> This instruction doesn't work on all models of the Z80 CPU. It doesn't
> eixst in most assemblators that you can ny. The opcodes are (hex):
> 
> SLS A       CB 37
> SLS B       CB 30
> SLS C       CB 31
> SLS D       CB 32
> SLS E       CB 33
> SLS H       CB 34
> SLS L       CB 35
> SLS (HL)    CB 36
> SLS (IX+d)  DD CB d 36
> SLS (IY+d)  FD CB d 36
> 
> I made a testprogram like this to see if it worked (which it did):
> 
> #include ti-85.h
> 
> .org 0
> .db "SLS",0
> 
>  ROM_CALL(CLEARLCD)
>  ld hl,0
>  ld ($800C),hl
>  ld a,8
>  .db $CB,$37
>  ld h,0
>  ld l,a
>  ROM_CALL(D_HL_DECI) ; Will show 17 if SLS works
> WaitKey:
>  call GET_KEY
>  or a
>  jr z,WaitKey
>  ret
> 
> .end
> 
> --
> Real name: Jimmy Mardell
> Email....: mailto:mja@algonet.se
> IRC-name.: Yarin
> WWW......: http://www.algonet.se/~mja
> 
> "Strap me down with disillusion
>   Tie me up in lifelines
>    Nothing stops my thoughts from breeding
>     Nothing's stopping my mind" - Leather Strip
> 
> 
> 


References: