Updated Basic Assembly tutorial (markdown)

Simon Fortier 2018-05-13 21:44:21 -04:00
parent 0c0c991a85
commit 6b637452f3

@ -242,13 +242,14 @@ That is not the case with the game's CPU, which is a purely 16-bit processor.
### Memory and registers
Random-access memory (RAM) is a piece of hardware capable of storing data and accessing it in no particular order (hence the name). You can think of the memory as a pile of blocks, each block having an address and storage for data. In the game, memory is only accessed in 16-bit chunks so each "block" holds 16 bits of data. Here's how it looks:
[](link of pic)
![ram](https://user-images.githubusercontent.com/7120851/39974411-8b45fb4c-56f6-11e8-96db-5fd48089322f.png)
Each 16-bit block has an address (left).
Registers are individual storage blocks that are located inside the CPU. They are used in some instructions and can be written to or accessed just like memory, but they are referred by their name (A, B, X...) instead of by an address. On modern CPUs, registers are much faster to access than memory.
[](link of pic)
![regs](https://user-images.githubusercontent.com/7120851/39974430-b298c5e4-56f6-11e8-8963-89b42e3e1173.png)
Each register holds 16 bits of data
### Execution cycle