StanfordPL / x64asm

x86-64 assembler library
Apache License 2.0
465 stars 60 forks source link

create non-templated parent class for all memory operands #226

Closed bchurchill closed 8 years ago

bchurchill commented 8 years ago

To simplify the code, we use a curiously recurring template pattern for the x64asm memory classes. But, that makes things painful when you want to work with memory and you don't know its bitwidth. Therefore, I'm adding a new class called Mem that sits between Operand and the templated M<T> that abstracts away most of the functionality. That way we don't have to use templates to manipulate memory.

Also, in the past we would frequently cast memory arguments to a different type (e.g. M8) to do operations. We'll no longer need to do that.

This won't go into stoke until I've tested in my branches.