Document sections

simon987 2020-07-30 19:44:45 -04:00
parent e3e4b1781c
commit b82e445a3e

@ -125,8 +125,15 @@ someBigStaticMemoryBlock: DW 100 DUP(0x20), 0
It can only be used in combination with the `DW` directive It can only be used in combination with the `DW` directive
## Sections ## Sections
// TODO Sections are useful to organize your code.
There is currently two section, `.text` and `.data`. By default, the .data section implicitly starts at the beginning of your code and ends where the `.text` section starts, but you are allowed to reorder them as you wish. You must explicitly specify where the `.text` section starts.
At the beginning of each tick, your code is executed starting at the first instruction after the `.text` directive until it reaches the `BRK` instruction (See [Execution cycle](https://github.com/simon987/Much-Assembly-Required/wiki/CPU#execution-cycle).
Notes:
* There is nothing stopping you from executing code in the `.data` section (or to store variables in the `.text` section)
* There is no padding in between sections
## ORG ## ORG