ninezerozeronine / chip-computer

An 8 bit computer made from 74 series chips!
MIT License
0 stars 0 forks source link

Add MEMSWAP instruction #29

Open ninezerozeronine opened 5 years ago

ninezerozeronine commented 5 years ago

Something like:

MEMSWAP [#15] [#155]
MEMSWAP [A] [B]

The temporary value can be stored in the ALU register by passing it straight through the ALU.

This would replace something like:

PUSH A
PUSH B
LOAD [#15] A
LOAD [#155] B
STORE A [#155]
STORE B [#15]
POP B
POP A
ninezerozeronine commented 5 years ago

This actually needs 2 spare registers. The "secret" ALU reg isn't enough.