LZ: NEW Z80 INSTRUCTION FOUND!!


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

LZ: NEW Z80 INSTRUCTION FOUND!!



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


<pre>
--
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
</pre>