Open drcjt opened 1 year ago
Consider reviewing how ryujit represents instructions. See "Instruction Encoding" section in https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/jit/ryujit-overview.md
See #225 which now uses ideas from iced assembler to give a more natural representation for memory operations. So
assembler.Ld(R16.HL, MemoryOperand(4020));
Now becomes:
assembler.Ld(HL, __[4020]);
Note that can use HL for first parameter due to "using static" directive.
Currrently Z80 assembler is bit of a mish mash of methods and techniques for specifying operands.
If an operand is to refer to memory then could use a new class e.g. MemoryOperand as per how iced assembler does this. Will need something to indicate in the call that something is to be a memory operand e.g.
assembler.Ld(R16.HL, MemoryOperand(4020));
Would correspond to:LD HL, (4020)