Is it possible to perform some computations within the RAM?

前端 未结 2 1944
星月不相逢
星月不相逢 2021-01-20 18:32

Theoretically, is there any way to perform any computations within the RAM, using memory related instructions such as move, clflush or whatever, su

2条回答
  •  日久生厌
    2021-01-20 18:51

    Amazingly, yes, as per Paul R's comment: mov is Turing complete.

    Such a mov only computer would be (highly) impractical however. not to mention the fact that it would be fiendishly hard to write a compiler for it. There is a c compiler that translates general purpose c programs into x86 mov instructions. Amazingly it does allows floating point calculations.
    Because it is based on a Turing machine and not a Von Neumann computer it is horribly slow, (but it's a great way to obfuscate your code :-1).

    For all practical purposes you can only do calculations via registers.
    AFIAK only movs takes 2 memory operands, every other instruction that accesses memory uses a constant or register operand in addition.

    Rowhammer is not a calculation mechanism, because it is non-deterministic.
    It's also a artefact of the way dram is implemented, cache memory does not suffer from this effect.

提交回复
热议问题