Added direct memory access

This commit is contained in:
2019-11-23 16:47:16 +01:00
parent 22bb974a05
commit 1148682324
14 changed files with 329 additions and 92 deletions

View File

@@ -14,6 +14,7 @@
- `;` for end of statement (mandatory)
- `[label]:` for labels
- `#[text]` for comments: any text is ignored till a newline (`\n`) is found
- `[[%register|$value]]` for accessing memory
- Elements must be separated by whitespace character
- Good: `add $2 $5 %A;`
- Bad: `add $2$5%A;`
@@ -34,6 +35,12 @@ lti %B $10;
jmp loop;
```
Read the integer at memory location `1024` into register A:
```
seti %A [$1024];
```
Remember not to use spaces inside the `[` brackets.
## Reserved symbols
The following whitespace characters are used to separate symbols:
@@ -82,6 +89,8 @@ All symbols are reserved keywords and can therefore NOT be used as labels.
## Interupts
- 0..9 range:
- [0..9] Output to STDOUT
- `0` put value of register A as ASCII character on stdout
- `1` put value of register A as decimal integer on stdout
- `1` put value of register A as decimal integer on stdout
- `2` put value of register A as hexadecimal integer on stdout
- `3` put the string pointed at by register A for the amount of characters defined by register B on stdout