Quick OpCode Q...

edited February 2012 in Emulators
Leet emulat0r makerz....

I've seen two versions for this set of OpCodes, obviously they are undocumented....

FDCB d 40 BIT 0,(IY+d) (From Seans z80 doc)

FDCB d 40 BIT 0,(IY+d),B (This makes more sense.)

To save me digging out me hardware, could some kind soul please tell me which one is correct?
Post edited by Korinel on

Comments

  • edited February 2012
    FDCB d 40 BIT 0,(IY+d) (From Seans z80 doc)

    The instruction is to test bit 0 of (IY+d)

    Dunno what the B is supposed to be for in the other instruction.
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    Thanks Karingal!
  • edited February 2012
    karingal wrote: »
    Dunno what the B is supposed to be for in the other instruction.

    It's supposed to mean "also copy the result into register", however this doesn't happen with instruction BIT. Thus you are right, the first OpCode is correct in this case:
    FD CB d 40    BIT 0,(IY+d)
    

    However the OpCode for all other operations (except BIT) prefixed with FDCB should be represented with an extra register. For instance:
    FD CB d C0    SET 0,(IY+d),B
    

    The instruction above will read value from address (IY+d), set bit 0 of this value, then store result into both address (IY+d) and register B.
    Creator of ZXDB, BIFROST/NIRVANA, ZX7/RCS, etc. I don't frequent this forum anymore, please look for me elsewhere.
  • edited February 2012
    It's supposed to mean "also copy the result into register", however this doesn't happen with instruction BIT. Thus you are right, the first OpCode is correct in this case:
    FD CB d 40    BIT 0,(IY+d)
    

    However the OpCode for all other operations (except BIT) prefixed with FDCB should be represented with an extra register. For instance:
    FD CB d C0    SET 0,(IY+d),B
    

    The instruction above will read value from address (IY+d), set bit 0 of this value, then store result into both address (IY+d) and register B.
    Or
    FD CB d C0      LD    B, SET 0, (IY+d)
    
    which actually makes more sense.
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    karingal wrote: »
    Or
    FD CB d C0      LD B,SET 0,(IY+d)
    
    which actually makes more sense.

    I agree it makes more sense than the original, but you are inventing a new notation thus no existing tools would support this.

    There's another notation I saw in a few documents, that I prefer since it's more compact, more legible and also makes more sense:
    FD CB d C0      SET 0,(IY+d)->B
    

    Although I have no idea if any existing tools support this one either.
    Creator of ZXDB, BIFROST/NIRVANA, ZX7/RCS, etc. I don't frequent this forum anymore, please look for me elsewhere.
  • edited February 2012
    I agree it makes more sense than the original, but you are inventing a new notation thus no existing tools would support this.

    There's another notation I saw in a few documents, that I prefer since it's more compact, more legible and also makes more sense:
    FD CB d C0      SET 0,(IY+d)->B
    

    Although I have no idea if any existing tools support this one either.
    This is all moot as it's not a documented instruction anyway and there is no guarantee that it works on all Z80's.
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    karingal wrote: »
    This is all moot as it's not a documented instruction anyway and there is no guarantee that it works on all Z80's.
    True, there's no guarantee. It does though :p

    I like the SET 0,(IY+d)->B style of syntax too (as appears in vbSpec's wonderful source code).
  • edited February 2012
    ccowley wrote: »
    True, there's no guarantee. It does though :p
    That makes absolutely no sense, true to form...
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    karingal wrote: »
    That makes absolutely no sense, true to form...
    Yes it does; there is no guarantee that it works on all Z80s. But, in actual fact, it does work on all Z80s.

    I know you WoSF mods are not the sharpest tools in the box, so I'll try to remember to simplify my genius outpourings a little in future for you :p
  • edited February 2012
    ccowley wrote: »
    Yes it does; there is no guarantee that it works on all Z80s. But, in actual fact, it does work on all Z80s.
    And you have proof it works on all Z80's?

    Zilog quite clearly said at the time they could not guarantee it would work on all Z80's due to certain manufacturing methods.
    I know you WoSF mods are not the sharpest tools in the box, so I'll try to remember to simplify my genius outpourings a little in future for you :p
    When you do offer us one of your genius outpourings can you please let us know as it would be a shame to miss such an important once in a lifetime experience...
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    karingal wrote: »
    And you have proof it works on all Z80's?
    No, I have no proof. It does though.
    Zilog quite clearly said at the time they could not guarantee it would work on all Z80's due to certain manufacturing methods.
    Yes, they did say that. But there are quite a few out there in the field now, do you know of any for which those instructions don't work? The point is, the "undocumented" instructions are now so well documented, well understood, and well used, that any hardware that doesn't implement them properly can quite comfortably be said to be incompatible with a Z80.
    When you do offer us one of your genius outpourings can you please let us know as it would be a shame to miss such an important once in a lifetime experience...
    Everything I write is genius... just not everyone is culturally and intellectually refined enough to appreciate it. I'm ace, me. :p
  • edited February 2012
    ccowley wrote: »
    Yes, they did say that. But there are quite a few out there in the field now, do you know of any for which those instructions don't work?
    Yes, mine. Prove it doesn't.
    I'm ace, me. :p
    That is about as culturally and intellectually refined as you get!!
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    karingal wrote: »
    Yes, mine. Prove it doesn't.
    If I claimed to have any form of proof, you might have the vaguest beginnings of a point there...
    That is about as culturally and intellectually refined as you get!!
    I think you mean "as one gets." :D
  • edited February 2012
    ccowley wrote: »
    I think you mean "as one gets." :D
    No, I was referring to you specifically.


    What was the original question again?
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    karingal wrote: »
    What was the original question again?
    *shrug* some nerdy stuff about CPUs I think.
  • edited February 2012
    ccowley wrote: »
    *shrug* some nerdy stuff about CPUs I think.
    Aah, boring stuff...
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    You go girls!











































































    No, seriously ... go! (you girlies!)
  • edited February 2012
    ZnorXman wrote: »
    You go girls!
    Not now. You've killed the mood, I'm afraid.
  • edited February 2012
    ccowley wrote: »
    Not now. You've killed the mood, I'm afraid.
    Aye, twos company...

























    Anyway get yer arse into #spin where we can verbally joust properly...
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    karingal wrote: »
    Anyway get yer arse into #spin where we can verbally joust properly...

    You only take tarties with you in there, you never invite me over, what, I'm not good enough conversation, it's been such a long time since you last gave me flowers and chocolates*, and you you keep leaving crumbs in the settee, I feel left out.

    *sniffle*

    :cry:


    *read: Never.
  • edited February 2012
    ZnorXman wrote: »
    You only take tarties with you in there, you never invite me over, what, I'm not good enough conversation, it's been such a long time since you last gave me flowers and chocolates*, and you you keep leaving crumbs in the settee, I feel left out.

    *sniffle*

    :cry:


    *read: Never.
    We only want people who offer genius outpourings...
    I wanna tell you a story 'bout a woman I know...
  • edited February 2012
    karingal wrote: »
    We only want people who offer genius outpourings...

    And now sir is disparaging us in the first person plural... how impersonal.
    :cry:
  • edited February 2012
    ZnorXman wrote: »
    You only take tarties with you in there.
    Hmm... I'm not sure exactly what a tartie is, but I'm pretty sure that's the first time I've ever been called one! I kinda like it though :lol:
  • edited February 2012
    ccowley wrote: »
    Hmm... I'm not sure exactly what a tartie is, but I'm pretty sure that's the first time I've ever been called one! I kinda like it though :lol:

    You didn't know that the pluralses of "tart" is "tarties" ?!?!?! :D

    You is all just a bunches of tarties out there in IRC-land! :-P


    ( This is NOT chit-chat, you off-topicers. -Ed )
  • edited February 2012
    ZnorXman wrote: »
    You is all just a bunches of tarties out there in IRC-land! :-P
    I ain't been in any form of IRC channel since some time last year. :p
  • edited February 2012
    ccowley wrote: »
    I ain't been in any form of IRC channel since some time last year. :p

    Well, good for you! icon14.gif

    Keep it up, karingal keeps saying IRC's full of spotty-faced, limp-noggin, flouncy-bouncers over there anyway.
Sign In or Register to comment.