From 85488915118ebe7b739a98fd143d7a8cbb775a5d Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sun, 18 Apr 2021 00:57:33 +0200 Subject: [PATCH] added assembly docs --- docs/assembly.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docs/assembly.md diff --git a/docs/assembly.md b/docs/assembly.md new file mode 100644 index 0000000..54016a5 --- /dev/null +++ b/docs/assembly.md @@ -0,0 +1,23 @@ +# Assembly + +Assembly tokenization should be workiung completely. It knows what instructions the CPU implementation supports and parses based on them. + +## Pseudo-ops +The following pseudo-ops are implemented as of yet: +* `.space ` reverse bytes of zero +* `.ascii 'text'` put text into memory +* `.asciiz 'text'` put text into memory (null terminated) +* `.sextion .` same as `.` see sections: + +## Sections: +Currently only these three sections are supported: +* `data` read-write data (non-executable) +* `rodata` read-only data (non-executable) +* `.text` executable data (read-only) + +## Allocating stack +another pseudo-op is recognized: `.stack `. This marks the executable as requesting at least `` bytes of stack. +If the loader repsects this wish, the sp is initialized pointing to the end of the stack. + + +