Why are registers needed (why not just use memory)?

I'm just starting to learn Assembly (I've worked with before).

I wonder why we need to use registers in addition to using memory, why not just use memory?

I think the most obvious reason is that doing calculations in a register is much faster than doing calculations in memory. But is this the only reason?

+4
source share
2 answers

Because the RAM is slow. So slow.

CPU, ALU, . , , .

  • , .

, ?

. , CPU. . SRAM, , , .

DRAM, , , DRAM . ,

: ?

+9

, . , , , 512 , 64 32 16- . , , " " MosTek 6502 ( 0-255, 1- ) - . .

:

  • . , , DRAM. ( - , , SRAM. SRAM .) . DRAM , 200 1000. L1, 2-4 .

  • . , - .

  • (, , hart) . ( , , , , zSeries, , .)

  • , . , .

, , , . " " , , " ", " ", " ALU", " " .., (, ) ; .. , , , .

+3

Source: https://habr.com/ru/post/1683302/


All Articles