mirror of https://git.cro.wtf/kip.git
Compare commits
4 Commits
f6adc48341
...
15e891cd6c
Author | SHA1 | Date |
---|---|---|
Kitty-Cricket Piapiac | 15e891cd6c | |
Kitty-Cricket Piapiac | 0f966ce470 | |
Kitty-Cricket Piapiac | b16596a1fb | |
Kitty-Cricket Piapiac | 9cc0d78fc9 |
|
@ -8,7 +8,7 @@ The kip is a fantasy computer based on the 32-bit kmx20 stack processor. This re
|
|||
|
||||
* A C11 Compiler
|
||||
* Meson + Ninja
|
||||
* Sdl2
|
||||
* SDL2
|
||||
* The source tree
|
||||
|
||||
### Acquiring the source
|
||||
|
@ -35,7 +35,7 @@ $ meson test -C b # optional, just run tests
|
|||
* `./w/` - doc -> html -> www
|
||||
* `./x/` - examples
|
||||
|
||||
You can find more examples of code [git.cro.wtf/kcp/mow.git](https://git.cro.wtf/kcp/mow.git)
|
||||
You can find more examples of code at [git.cro.wtf/kcp/mow.git](https://git.cro.wtf/kcp/mow.git)
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ A token has a type, or 'colour' based on its first character.
|
|||
|:------|:------------------------------------------------------|
|
||||
|`{` | Comment. All text until the next `}` is ignored. |
|
||||
|`"` | String literal. This is included in the resultant binary literally. *(e.g. "meow" puts the string "meow" in the output binary)* |
|
||||
|`#` | Hexadecimal literal. The amount of bytes included in the output binary is either 1, 2, or 4 based on length. Numbers are little-endian. *(e.g. #00 outputs a byte, #0000 half a word, and #00000000 a full word)* |
|
||||
|`#` | Hexadecimal literal. The amount of bytes included in the output binary is either 1, 2, or 4 based on length. Numbers are big-endian. *(e.g. #00 outputs a byte, #0000 half a word, and #00000000 a full word)* |
|
||||
|`:` | Label definition |
|
||||
|`@` | 32-bit reference to label *(e.g. `pw @label ju` would jump to the label defined by `:label`)* |
|
||||
|`^` | 8-bit relative reference to label *(e.g. `pr ^label ju` would jump to the label defined by :label)* |
|
||||
|
|
|
@ -22,6 +22,7 @@ The kmx20 has 2 data busses.
|
|||
- Memory bus
|
||||
- Byte-addressed
|
||||
- Where data is to be read and writ
|
||||
- Numbers greater than 1 byte are stored and read in big-endian order
|
||||
- Interrupt Vector Table starts at address `#00000`
|
||||
- CPU resets to address `#00100`
|
||||
- Data stack lives in mem at `#40000`
|
||||
|
@ -55,9 +56,8 @@ The kmx20 has 2 data busses.
|
|||
|
||||
## Instructions
|
||||
|
||||
Instructions take 1 byte in memory. If you looked at an instructions binary representation with letters: `0KFOOOOO`
|
||||
Instructions take 1 byte in memory. If you looked at an instructions binary representation with letters: `KFOOOOOO`
|
||||
|
||||
- `0` is unused
|
||||
- `K` if set will keep *all* left hand operands. *(e.g. `(a -- n)` becomes `(a -- a n)`)*
|
||||
- `F` if set will flip return and data stacks. *(e.g. `pb` with `F` puts the next byte on the return stack.)*
|
||||
- `O` is the 5-bit opcode. See the table below.
|
||||
|
|
Loading…
Reference in New Issue