[A83] Re: program counter value
[Prev][Next][Index][Thread]
[A83] Re: program counter value
> Van: The one and only SUCKER ... <sucker_pvn@hotmail.com>
>
> Is there a way to get the value of the Program Counter?
> I know "ld CP,hl" does not exist, but does somebody know
> how?
Your 'instruction' should probably have been "ld hl,pc", but anyways just
fun that you brought up this. I've been thinking about abfuscated Z80
instructions lately (maybe nice for the Crappy Coders Guild). Just use the
TASM .addinstr function, a shame that I don't know how it works (I know,
RTFM)
ld pc,hl = jp (hl)
ld pc,de = push de \ ret = jp (de)
ld pc,bc = push bc \ ret = jp (bc)
ld pc,af = push af \ ret = jp (af)
pop pc = ret
inc pc = nop
push pc,[ld ]xxxx = call xxxx
There might be even more...
Henk Poley <><