Re: A85: Most unused opcode


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

Re: A85: Most unused opcode





I don't think a single marker byte is feasible (a jr instruction can have
any byte after it).  However, a multi-byte marker may be feasible.  At the
end of this email are some opcodes that are rarely, if ever, used,
especially two or three times in a row.  (The ones I chose aren't likely
to appear in ASCII strings either.)  However, note that even an
instruction like ld hl,XXXX or call XXXX may introduce two arbitrary bytes
into your code.  Worse, a .db or .dw can introduce any sequence of
arbitrary bytes into your code.

I think a better solution than storing a marker byte is this: simply store
the OFFSET into your code where the "mark" is.  This offset could be
stored either in a fixed location, or within the program itself (e.g. at
the beginning or end).  This would eliminate the need for the search.

But in case you can't for some reason just store the offset of the mark,
here are some uncommon opcodes anyway:

instruction		; opcode
LD A,A			; 7F
RST 8H                  ; CF
RST 10H                 ; D7
RST 18H			; DF
RST 20H                 ; E7
RST 28H			; EF
RST 30H			; F7
RST 38H			; FF

Mike

On Thu, 12 Nov 1998, Richard Owen Lewis wrote:
> 
> This is a survey kind of thing.  I need to know what you guys think the 
> most unused Z80 opcode is on the 85.
> 
> Yes, there is a purpose to this.  I need to have some kind of marker byte, 
> inside my code, so at runtime, I can have a program search through the 
> code,  pick out my marker, patch in some code that needs to be there, and 
> then when its done, put it back the way it was.
> 
> If this proves to be completely unfeasable, I'll just have to work on a new 
> relocation routine (my old one is buggy, and I don't remember how it works 
> anyway =)
> 
> Yes, this is for Summit, in case somebody is wondering.
> 
> 
> 


References: